Kenshi,
I'm sorry that I completely forgot about this issue.
I just took a look and it seems to be due to a bug in clabel routine.
The fix is easy and I'll commit it soon. Meanwhile, here is a work
around. Basically, you need to draw a contour in "ax3", not in
"aux_ax3".
First of all, you can populate Z without for loops (note that I
changed X, Y to Theta, R).
Theta, R = meshgrid(theta, r)
Z = (Theta/90.)**2 + (R-2)**2
Now, instead of aux_ax3.contour, use
CS = aux_contour(aux_ax3, Theta, R, Z,levels,colors='k')
where aux_contour is defined as
def aux_contour(aux_ax, aux_X, aux_Y, Z, *kl, **kwargs):
ax = aux_ax._parent_axes
shape_orig = Theta.shape
TR = np.array([aux_X, aux_Y]).reshape((2, -1)).transpose() #
coordinates in aux_ax
XY = aux_ax.transAux.transform(TR) # coordinates in ax
X, Y = XY.transpose().reshape((2, shape_orig[0], shape_orig[1]))
CS = ax.contour(X, Y, Z, *kl, **kwargs)
return CS
And do clabel with the original axes (ax3). use_clabeltext will help
the labels aligned with contour lines.
ax3.clabel(CS,fontsize=10, use_clabeltext=True)
A complete example is attached.
Regards,
-JJ
tererer.py (3.23 KB)
···
On Fri, Sep 17, 2010 at 7:34 PM, Kenshi hibino <hibino@...3274...> wrote:
Jae-Joon Lee wrote:
Another option is to use mpl_toolkits.axisartist (distributed with mpl
1.0). However, learning curve of the axisartist is also steep. You may
play around with the last figure in the example below.
http://matplotlib.sourceforge.net/examples/axes_grid/demo_floating_axes.html
Jae-Joon,
Thanks for the quick reply and good advice.
Second option you recommended is seemed to work well.
My code modified from example is attached.
But, in semi-circle domain I can't write contour label using clabel().
Do you know the reason why? http://old.nabble.com/file/p29737063/test2.py
test2.py
For reference my system is python(x,y) on Windows and mpl version is 1.0
Thanks again.
Kenshi
--
View this message in context: http://old.nabble.com/contour-plot-in-semi-circle-domain-tp29699332p29737063.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options