[yt-users] axis ticks problem in ProjectionPlot function

Ji Suoqing jisuoqing at gmail.com
Mon Aug 13 12:11:54 PDT 2012


Hi John,

I'm grateful for your explanation.

The tick problem might be a small issue, but it's not a wise choice to modify by hand.

Best wishes,
Suoqing

在 2012-8-13,下午3:07,John ZuHone <jzuhone at gmail.com> 写道:

> Suoqing,
> 
> The weird lines you are seeing for a constant density plot are likely due to the fact that by default yt is looking for the min/max of your dataset to set the colorbar, and because you have a constant density the min/max is whatever differences from that value arise due to machine precision. 
> 
> Best,
> 
> John ZuHone
> 
> On Aug 13, 2012, at 3:04 PM, Ji Suoqing wrote:
> 
>> Hi Nathan,
>> 
>>> what you mean by 'set the domain.'
>> 
>> This is defined in FLASH4 as runtime parameter, which means that in FLASH hdf5 file, the domain has already been intrinsically set to [0.0, 1.0, 0.0, 1.0].
>> 
>> So a simple script for this plot is just:
>> 
>> from yt.mods import *
>> pf=load('pringle_hdf5_chk_0000')
>> p1 = ProjectionPlot(pf, "z", "Density")
>> p1.save()
>> 
>> So I just attach two figures generated by YT and VisIt respectively, from which you could see the axis tick difference. In VisIt the axis ticks is correct, while in YT is not.
>> 
>> I suspect in YT, the domain edge should be firstly grasped, based on which the axis ticks could be correctly set.
>> 
>> Thanks for your care.
>> 
>> Best wishes,
>> Suoqing
>> 
>> VisIt plot: http://dl.dropbox.com/u/83265784/visit0000.png
>> YT plot: http://dl.dropbox.com/u/83265784/YT_pringle_hdf5_chk_0000_Projection_z_Density.png
>> 
>> P.S. What is plotted out is a constant density field with AMR, while YT seems have weird plot in such case, just as the figure shown. But I do not care too much about this because I do not treat constant field.
>> 
>> 在 2012-8-13,下午2:44,Nathan Goldbaum <nathan12343 at gmail.com> 写道:
>> 
>>> Hi Suoqing,
>>> 
>>> I'm unable to reproduce the error you're seeing and I'm not sure what you mean by 'set the domain.'  Would you mind forwarding the full script you used to produce the plot?
>>> 
>>> Cheers,
>>> 
>>> Nathan
>>> 
>>> On Aug 13, 2012, at 11:40 AM, Ji Suoqing wrote:
>>> 
>>>> Hi all,
>>>> 
>>>> I've found a small problem in ProjectionPlot function: in FLASH4 data, I've already set the domain to be, say:
>>>> 
>>>> xmin=0.0
>>>> xmax=1.0
>>>> ymin=0.0
>>>> ymax=1.0
>>>> 
>>>> But when I use ProjectionPlot to plot the figure, the axis ticks become -0.5<x<0.5, -0.5<y<0.5; while in VisIt, the axis ticks are right. Also, in YT if I print out:
>>>> 
>>>> pf.domain_left_edge & pf.domain_right_edge
>>>> 
>>>> the domain is correct: 0<x<1, 0<y<1.
>>>> 
>>>> I've found this in 2d cylindrical case, where x represents for r direction, and y for z direction. I'm not sure whether in cartesian coordinate the same problem exists or not.
>>>> 
>>>> Best wishes,
>>>> Suoqing
>>>> _______________________________________________
>>>> 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
>> 
>> _______________________________________________
>> 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




More information about the yt-users mailing list