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
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, shape_orig))
CS = ax.contour(X, Y, Z, *kl, **kwargs)
And do clabel with the original axes (ax3). use_clabeltext will help
the labels aligned with contour lines.
A complete example is attached.
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.
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
For reference my system is python(x,y) on Windows and mpl version is 1.0
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.
Matplotlib-users mailing list