[yt-users] setting limits of the colorbar

luigi at ita.uni-heidelberg.de luigi at ita.uni-heidelberg.de
Wed Jan 21 06:41:57 PST 2009


Hi Matt,

thanks for the fix, it works as expected! I would add a small  
suggestion: now the user can set the color scale between zmin and  
zmax, and the color is set to white (or background) for z > zmax or z  
< zmin. For visualisation purposes, maybe it would be more appropriate  
to set the color to "color(zmax)" (upper boundary of the color scale)  
for z > zmax, whereas the white background for z < zmin is certainly  
more readable. But this is probably a matter of taste... the tool is  
OK also as it is now, provided the extremes are wisely chosen by the  
user.
Cheers,

   Luigi

Quoting Matthew Turk <matthewturk at gmail.com>:

> Hi Luigi,
>
> You're actually doing everything correctly -- there was just a bug!
> It had been fixed in trunk, but not in the yt-1.0 branch, so I went
> ahead and backported it.  If you execute "svn up" in your src/yt
> directory, it should work now.  (Depending on which version of the
> installation script you have, rerunning it should also work.  You may
> also have to execute "python2.5 setup.py develop" in the yt
> directory.)
>
> Let me know if there are any more problems -- but I was able to
> replicate your problem, and the committed change in r1130 has fixed it
> for me.  Good luck!
>
> -Matt
>
> On Tue, Jan 20, 2009 at 3:29 AM,  <luigi at ita.uni-heidelberg.de> wrote:
>> Dear all,
>>
>> I am currently trying to plot a 2D phase diagram (T vs rho). The plot is OK,
>> but I have problems with setting the limits of the colorbar (where
>> CellMassMsun is color-coded). Somehow, they are set automatically, which is
>> bad, because I need to compare several plots of different datasets. The
>> set_zlim command does not apparently affect the plot. I copy here my script,
>> and I hope for some suggestions of yours.
>> Thanks in advance,
>>
>>  Luigi
>>
>> ----------
>>
>> #!/lrz/sys/graphics/yt/1.0/bin/python2.5
>>
>> # importing modules
>> from yt.mods import *
>> import numpy as na
>>
>> out_dir="/home/hlrb2/h0973/h0973aa/test-runs/test-yt/"
>> # path for the output of this script
>>
>> data_dir="/ptmp2/h0973/h0973aa/lss-sgs/64cubed/sgs0/files/outdir/"
>> # path for ENZO data
>>
>> #xmin=3e-33
>> #xmax=3e-26
>> ymin=5e1
>> ymax=3e8
>> zmin=1e4
>> zmax=1e14
>>
>> ##############################################################################
>>
>> times = [] # in code units
>> red = []
>>
>> # the main cycle over the outputs (if more than one)
>>
>> pf = lagos.EnzoStaticOutput(data_dir+"RedshiftOutput0014")
>>
>> red = pf["CosmologyCurrentRedshift"]
>>
>>
>> print " \n "
>> print "Analyzing data:"
>> print "Redshift= "+str(red)
>> print " \n "
>>
>> pc = raven.PlotCollection(pf, center=[0.5,0.5,0.5])
>>
>> pc.set_zlim(zmin,zmax)
>> pc.add_phase_sphere(1.0,"1", ["Density", "Temperature", "CellMassMsun"],
>>    weight=None, x_bins=128,y_bins=128,#x_bounds=[xmin,xmax],
>>    y_bounds=[ymin,ymax],lazy_reader=True)
>> #pc.set_zlim(zmin, zmax)
>> pc.save("l64-sgs0",override=True)
>>
>> ---------------
>>
>> ---------------------------------------------------------------
>>
>> Luigi Iapichino
>> Zentrum fuer Astronomie der Universitaet Heidelberg
>> Institut fuer Theoretische Astrophysik
>> Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany
>> Tel: +49 6221 548983, Fax: +49 6221 544221
>> e-mail: luigi at ita.uni-heidelberg.de
>> URL: http://www.ita.uni-heidelberg.de/~luigi/
>>
>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



---------------------------------------------------------------

Luigi Iapichino
Zentrum fuer Astronomie der Universitaet Heidelberg
Institut fuer Theoretische Astrophysik
Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany
Tel: +49 6221 548983, Fax: +49 6221 544221
e-mail: luigi at ita.uni-heidelberg.de
URL: http://www.ita.uni-heidelberg.de/~luigi/






More information about the yt-users mailing list