So I have a (slightly) new plot type I would like to add to the matplotlib codebase, and I'd like to ask A) if people would be interested in the patch and B) what the best way to implement it would be. I am currently calling the plot type "pcontourf"--it's essentially a pcolor, but instead of a continuous color spectra of value, it plots discrete levels of data like contourf does. I find this kind of plot useful for model output--it displays the model grid, and also emphasizes data transitions, for example, between the negative and positive areas of a plot, better than pcolor. Essentially it is just a contourf wrapper that, instead of calling contourf with values at the 'center' of a grid cell, calls contourf with points at the edges of the grid cell so you end up with rectangular areas. If someone is actually interested in clean this up and put it into svn, my next question is where in the codebase would be the best place to put it so I can make a clean diff file? pyplot.py? I don't quite understand how the matplotlib module hierarchy works. Jordan
Jordan, This sounds useful, but I think it can be implemented without any new plot type, simply by using a different sort of norm to do the colormapping. I need to add this anyway, and I have a prototype. It is very simple. I will get it in within the next few days, and then you can see whether it meets your needs. Eric Jordan Dawe wrote: > So I have a (slightly) new plot type I would like to add to the > matplotlib codebase, and I'd like to ask A) if people would be > interested in the patch and B) what the best way to implement it would be. > > I am currently calling the plot type "pcontourf"--it's essentially a > pcolor, but instead of a continuous color spectra of value, it plots > discrete levels of data like contourf does. I find this kind of plot > useful for model output--it displays the model grid, and also emphasizes > data transitions, for example, between the negative and positive areas > of a plot, better than pcolor. Essentially it is just a contourf > wrapper that, instead of calling contourf with values at the 'center' of > a grid cell, calls contourf with points at the edges of the grid cell so > you end up with rectangular areas. > > If someone is actually interested in clean this up and put it into svn, > my next question is where in the codebase would be the best place to put > it so I can make a clean diff file? pyplot.py? I don't quite > understand how the matplotlib module hierarchy works. > > Jordan > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
I was just working with a student to do this. It is straightforward (using norms, as Eric suggests), but not short. I think it would be good to include wrappers for creating these norms to MPL. The advantage is then it works for everything: pcolor, scatter, etc. -Rob On Jan 31, 2008, at 12:07 AM, Eric Firing wrote: > Jordan, > > This sounds useful, but I think it can be implemented without any new > plot type, simply by using a different sort of norm to do the > colormapping. I need to add this anyway, and I have a prototype. > It is > very simple. I will get it in within the next few days, and then you > can see whether it meets your needs. > > Eric > > Jordan Dawe wrote: >> So I have a (slightly) new plot type I would like to add to the >> matplotlib codebase, and I'd like to ask A) if people would be >> interested in the patch and B) what the best way to implement it >> would be. >> >> I am currently calling the plot type "pcontourf"--it's essentially a >> pcolor, but instead of a continuous color spectra of value, it plots >> discrete levels of data like contourf does. I find this kind of plot >> useful for model output--it displays the model grid, and also >> emphasizes >> data transitions, for example, between the negative and positive >> areas >> of a plot, better than pcolor. Essentially it is just a contourf >> wrapper that, instead of calling contourf with values at the >> 'center' of >> a grid cell, calls contourf with points at the edges of the grid >> cell so >> you end up with rectangular areas. >> >> If someone is actually interested in clean this up and put it into >> svn, >> my next question is where in the codebase would be the best place >> to put >> it so I can make a clean diff file? pyplot.py? I don't quite >> understand how the matplotlib module hierarchy works. >> >> Jordan >> >> >> --------------------------------------------------------------------- >> ---- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel ---- Rob Hetland, Associate Professor Dept. of Oceanography, Texas A&M University http://pong.tamu.edu/~rob phone: 979-458-0096, fax: 979-845-6331
On Thu, Jan 31, 2008 at 08:38:35AM +0100, Rob Hetland wrote: > > I was just working with a student to do this. It is straightforward > (using norms, as Eric suggests), but not short. I think it would be > good to include wrappers for creating these norms to MPL. > > The advantage is then it works for everything: pcolor, scatter, etc. Couldn't you also do this by providing a short colourmap instead of fiddling the norms? - Paul
Eric Firing wrote: > Jordan, > > This sounds useful, but I think it can be implemented without any new > plot type, simply by using a different sort of norm to do the > colormapping. I need to add this anyway, and I have a prototype. It > is very simple. I will get it in within the next few days, and then > you can see whether it meets your needs. > > Eric I assume you mean to use pcolor for this kind of plot, but with the added ability to specify levels. This doesn't do what I want; I want the ability to make large contiguous contourf-style areas outlined with contour-style lines that follow the grid edges, not the hundreds of little squares that pcolor makes. But I agree that this may not be useful enough to warrant a new plot type. I'll just keep using my hacked add-on code and if anyone else wants this kind of functionality, you can direct them to me. Jordan
Paul Kienzle wrote: > On Thu, Jan 31, 2008 at 08:38:35AM +0100, Rob Hetland wrote: >> I was just working with a student to do this. It is straightforward >> (using norms, as Eric suggests), but not short. I think it would be >> good to include wrappers for creating these norms to MPL. >> >> The advantage is then it works for everything: pcolor, scatter, etc. > > Couldn't you also do this by providing a short colourmap instead of > fiddling the norms? Yes, but it is not as general a solution. The BoundaryNorm that I will add allows arbitrary color boundaries, just as the specification of levels in contourf does. Eric > > - Paul