[Matplotlib-users] superimposition of Cartesian projection axis on a polar axis on the same position

2011-09-14 Thread Youngung Jeong
Hi,

I have x-y grid data with z values and want to have a pixel view and contour
view at the same time on the same position. Both cases should have polar
coordinate system but since contour function does not plot on the polar
coordinate system, it is plotted on a rectilinear projection with converting
the polar grid into x-y grid. Please let me know if this isn't true.

For pixel view, pcolormesh was used. The subplot was added with specifying
the projection='polar', as something like below:

 axp=fig.add_subplot(1,1,1,projection='polar')
 axr=fig.add_subplot(2,2,1)

Then, I will have two independent axes shown in the figure canvas.
Since I want to place the two axes on the same position, if allowed, I would
like to do:

 axp=fig.add_subplot(1,1,1,projection='polar')
 axr=fig.add_subplot(1,1,1)

But it only gives one axis added to 'fig.axes'.
Is there any work-around? Or am I missing some other feature of matplotlib?

Youngung
--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerryreg; mobile platform with sessions, labs  more.
See new tools and technologies. Register for BlackBerryreg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] superimposition of Cartesian projection axis on a polar axis on the same position

2011-09-14 Thread Benjamin Root
On Wed, Sep 14, 2011 at 3:08 PM, Youngung Jeong youngung.je...@gmail.comwrote:

 Hi,

 I have x-y grid data with z values and want to have a pixel view and
 contour view at the same time on the same position. Both cases should have
 polar coordinate system but since contour function does not plot on the
 polar coordinate system, it is plotted on a rectilinear projection with
 converting the polar grid into x-y grid. Please let me know if this isn't
 true.

 For pixel view, pcolormesh was used. The subplot was added with specifying
 the projection='polar', as something like below:

  axp=fig.add_subplot(1,1,1,projection='polar')
  axr=fig.add_subplot(2,2,1)

 Then, I will have two independent axes shown in the figure canvas.
 Since I want to place the two axes on the same position, if allowed, I
 would like to do:

  axp=fig.add_subplot(1,1,1,projection='polar')
  axr=fig.add_subplot(1,1,1)

 But it only gives one axis added to 'fig.axes'.
 Is there any work-around? Or am I missing some other feature of matplotlib?

 Youngung


There are some ways to do this, but I haven't tried them myself.

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axislines.html

Ben Root
--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerryreg; mobile platform with sessions, labs  more.
See new tools and technologies. Register for BlackBerryreg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] superimposition of Cartesian projection axis on a polar axis on the same position

2011-09-14 Thread Jae-Joon Lee
On Thu, Sep 15, 2011 at 5:08 AM, Youngung Jeong
youngung.je...@gmail.com wrote:
 But it only gives one axis added to 'fig.axes'.
 Is there any work-around? Or am I missing some other feature of matplotlib?

Somehow, this is not clearly documented for the subplot command.
You need to use label parameter to create multiple axes at a same
position (for more details,
http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.add_axes)


axr=fig.add_subplot(1,1,1, label=r)
axp=fig.add_subplot(1,1,1,projection='polar', label=p)

Regards,

-JJ

--
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] superimposition of Cartesian projection axis on a polar axis on the same position

2011-09-14 Thread Jae-Joon Lee
On Thu, Sep 15, 2011 at 6:18 AM, Benjamin Root ben.r...@ou.edu wrote:
 There are some ways to do this, but I haven't tried them myself.

 http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axislines.html

 Ben Root


You may better stick to the subplot with polar projection if your
original data is in polar coordinate.
The axislines module basically assumes that your data is in rectlinear
coordinate system. It only draws the gridlines and labels in
curvelinear system (although you can combine both).

Regards,

-JJ

--
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] superimposition of Cartesian projection axis on a polar axis on the same position

2011-09-14 Thread Jae-Joon Lee
On Thu, Sep 15, 2011 at 5:08 AM, Youngung Jeong
youngung.je...@gmail.com wrote:
 but since contour function does not plot on the polar coordinate system

I think this is not True, but I may misunderstood you. Can you post an
example that does not work? Here is a simple example that shows it
does work. But I hardly use polar coordinate, and my example could be
too simple.


ax = subplot(111, polar=True)

aa = np.indices((10,10))
x = np.linspace(0., np.pi*2, 10)
y = np.linspace(0., 10, 10)

ax.pcolormesh(x, y, aa[0], cmap=gray)
ax.contour(x, y, aa[0])

Both pcolormesh and contour gives a consistent result.

However, I think, while the resulting contour lines are drawn in polar
coordinate system, the actual contouring is done in rectlinear
cooridinate system. So there may be some caveats.

Regards,

-JJ

--
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users