From: Roberto De A. <ral...@gm...> - 2004-10-05 13:15:11
|
Hi, I was wondering about the status of polar plots -- the website says only "work underway" If no one is working on this, I'm interested on implement polar plots (and also imshow, pcolor, etc). Roberto -- Roberto De Almeida <ro...@de...> this email is: [ ] bloggable [ ] ask first [ ] private [x] nonsense |
From: John H. <jdh...@ac...> - 2004-10-06 02:03:55
|
>>>>> "Roberto" == Roberto De Almeida <ral...@gm...> writes: Roberto> Hi, I was wondering about the status of polar plots -- Roberto> the website says only "work underway" If no one is Roberto> working on this, I'm interested on implement polar plots Roberto> (and also imshow, pcolor, etc). The work in progress claim is a bit overstated. If you search the user's mailing list for polar, you'll see some code that was posted that essentially provides a poorman's polar plot. It makes plot that roughly do the right things vis-a-vis polar, but to "do it right (tm)" you'll need to implement a polar axis class, derived from the Axis base class (eg use patch.Circle to draw the theta axis). A polar transform class is defined in the _transforms module. Among the other changes, you'll want to set the default transform for polar axes. If you decide you want to jump in, let me know and I'll write a more long winded email about what I think is involved, bearing in mind that I haven't actually implemented any of this code so my comments should be taken with a grain of salt. I'm not clear about the context of your mention of imshow and pcolor; could you elaborate? JDH |
From: Roberto De A. <ral...@gm...> - 2004-10-06 08:34:55
|
On Tue, 05 Oct 2004 20:14:44 -0500, John Hunter <jdh...@ac...> wrote: > The work in progress claim is a bit overstated. If you search the > user's mailing list for polar, you'll see some code that was posted > that essentially provides a poorman's polar plot. It makes plot that > roughly do the right things vis-a-vis polar, but to "do it right (tm)" > you'll need to implement a polar axis class, derived from the Axis > base class (eg use patch.Circle to draw the theta axis). A polar > transform class is defined in the _transforms module. Among the other > changes, you'll want to set the default transform for polar axes. Yes, my idea is to do it "properly", but I'm still getting myself familiar with the code. My original plan was to create a class PolarSubplot(PolarAxes), in the same way that Subplot derives from Axes. I would then create the PolarAxes class, implementing all the necessary methods, like plot(), imshow(), etc. That's why I mentioned imshow() and pcolor(), because my idea is to implement not only line plots, but specially pseudo color plots on the polar axes. After looking at the code for transforms, though, I'm not sure if all this is really necessary. It seems to me that I can define a polar transform, and simply reuse all the methods already defined in the Axes class to the all the work, is that right? I saw the PolarXY transform in the _transforms module, but it seems to be just a stub (matplotlib 0.63.0) -- it has no defined methods. > If you decide you want to jump in, let me know and I'll write a more > long winded email about what I think is involved, bearing in mind that > I haven't actually implemented any of this code so my comments should > be taken with a grain of salt. A few more details would be great. As I said, I'm still looking at the code and getting used to how things work. I would be very happy to contribute with matplotlib, it's a fantastic work and something that was missing in the Python world for quite a long time. Roberto -- Roberto De Almeida <ro...@de...> this email is: [ ] bloggable [ ] ask first [ ] private [x] nonsense |
From: John H. <jdh...@ac...> - 2004-10-11 14:17:15
|
>>>>> "Roberto" == Roberto De Almeida <ral...@gm...> writes: Roberto> Yes, my idea is to do it "properly", but I'm still Roberto> getting myself familiar with the code. Roberto> My original plan was to create a class Roberto> PolarSubplot(PolarAxes), in the same way that Subplot Roberto> derives from Axes. I would then create the PolarAxes Roberto> class, implementing all the necessary methods, like Roberto> plot(), imshow(), etc. That's why I mentioned imshow() Roberto> and pcolor(), because my idea is to implement not only Roberto> line plots, but specially pseudo color plots on the polar Roberto> axes. Roberto> After looking at the code for transforms, though, I'm not Roberto> sure if all this is really necessary. It seems to me that Roberto> I can define a polar transform, and simply reuse all the Roberto> methods already defined in the Axes class to the all the Roberto> work, is that right? I believe creating a PolarAxes is the way to go. I would probably also derive specialized Axis classes as well to handle the r and theta axis, using a matplotlib.patches.Circle rather than a matplotlib.lines.Line2d for the theta axis and grid lines. You would probably also need to add a rotation property to the ticks class, do that the ticks could be placed normal to the theta axis. I could help out here - it might call for a new line style, one along the lines of '_', '|' (which the current ticks use) but that could be rotated. Once you get the axis, transformations and grids set up right, yes, I believe you will be able to reuse many of the plotting methods. I'm fairly certain some work will need to be done to make images, pcolors and other plots work with though. But the basic plot and friends should work without modification. Roberto> I saw the PolarXY transform in the _transforms module, Roberto> but it seems to be just a stub (matplotlib 0.63.0) -- it Roberto> has no defined methods. Yes and no. The PolarXY class defines in _transforms.h // the api forward and inverse functions; theta in radians std::pair<double, double> operator()(const double& r, const double& theta ) { return std::pair<double, double>( r*cos(theta), r*sin(theta) ); } What is missing is a NonseparableTransformation class, developed along the lines of the SeparableTransformation, which utilizes a FuncXY rather than funcx and funcy. If you are not comfortable with c++ and the pycxx extension generator package, I would be happy to add this part. The polar axes would set a NonseparableTransformation with the FuncXY set to PolarXY. Roberto> A few more details would be great. As I said, I'm still Roberto> looking at the code and getting used to how things Roberto> work. I would be very happy to contribute with Roberto> matplotlib, it's a fantastic work and something that was Roberto> missing in the Python world for quite a long time. Great - I've been a bit out of the loop over the last week and will be playing catch-up this week, but will try and get the transform stuff into CVS for you ASAP so you can work on this. Thanks, JDH |