Lorenzo Isella wrote:
Eric Firing wrote:
Lorenzo,
1) What version of mpl are you using?
2) Please generate a short, simple stand-alone script that illustrates
the problem. Use some minimal amount of fake data, preferably
generated by a function rather than read from a table.
Eric
Dear Eric,
Thanks for your help.
(1) To be fair, I am quite a newbie and I do not know. I am using Debian
testing on my box; is there an easy way to find out what mpl I have
installed? However, I installed pylab from standard repositories, if
that matters.
import matplotlib
print matplotlib.__version__
(2) Here I first present a script with fake data (basically I generate a
function for the contour plot) and the original one using two input
data files (I have no really other choice here, since with a function I
cannot reproduce the bug so far).
The problem seems to be the previous plot, which is fouling up the
colorbar axes tick labeling. This looks like a bug, but I have not
tried to track it down. In any case if you don't make the previous plot
then the colorbar labeling is OK. See attached modification of your
second script.
Eric
#! /usr/bin/env python
from scipy import *
import pylab
nt=129
nr=88
nz=129
read3d=0
if (read3d!=0):
vel3d=pylab.load("vsection")
print 'the shape of vel3d is', shape(vel3d)
vel3d=vel3d.reshape(nt,nr,nz)
vel_section=vel3d[:,:,65]
pylab.save("vel_cross_section",vel_section)
elif (read3d==0):
vel_section=pylab.load("vel_cross_section")
rg2=pylab.load("rg2.out")
r=rg2[:,0]
theta=linspace(0.,2.*pi,nt)
#print "theta is ", theta
sin_t=sin(theta)
cos_t=cos(theta)
rsin_t=r[newaxis,:]*sin_t[:,newaxis]
rcos_t=r[newaxis,:]*cos_t[:,newaxis]
rsin_t=ravel(rsin_t)
rcos_t=ravel(rcos_t)
rsin_t.shape=(nt,nr)
rcos_t.shape=(nt,nr)
#pylab.colorbar()
#pylab.clf()
pylab.figure()
X = rsin_t.transpose()
Y = rcos_t.transpose()
Z = vel_section.transpose()
velmin = vel_section.min()
velmax = vel_section.max()
print velmin, velmax
levels = arange(velmin, velmax+0.01, 0.01)
pylab.contourf(X, Y, Z, levels, cmap=pylab.cm.jet)
pylab.colorbar()
#pylab.show()
pylab.savefig("velocity_on_section_DNS.png")
#pylab.hold(False)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users