[yt-users] creating a max_density and max_temperature sweep line plot

Nathan Goldbaum nathan12343 at gmail.com
Thu Apr 28 15:40:08 PDT 2016


Hi Tazkera,

I think you just need to make the 'test_plots' directory. I don't think
matplotlib will do that for you.

-Nathan

On Thu, Apr 28, 2016 at 5:38 PM, tazkera haque <h.tazkera at gmail.com> wrote:

> Hi,
>
> I am trying to create a max_dens and max_temp sweep plot in yt. I am using
> the following code
>
> for n in range (0,118):
>
>
>         fn = flashFolder+'super3d_hdf5_plt_cnt_%04d' % n
>         pf = yt.load(fn) # load data
>         #print pf.current_time
>
>         c = pf.h.find_max('temp')[1]
>         ax = 0 # take a line cut along the x axis
>
>         # cutting through the y0,z0 such that we hit the max density
>         #ray = ds.h.ortho_ray(ax, (c[1], c[2]))
>
>         # ray with start and end point
>
>         ray = pf.h.ray([0.,0.,0.],c)
>
>         # Sort the ray values by 'x' so there are no discontinuities
>         # in the line plot
>         srt = np.argsort(ray['x'])
>
>         plt.subplot(211)
>         plt.semilogy(np.array(ray['x'][srt]), np.array(ray['dens'][srt]))
>         plt.ylabel('dens')
>         plt.subplot(212)
>         plt.semilogy(np.array(ray['x'][srt]), np.array(ray['temp'][srt]))
>         plt.xlabel('x')
>         plt.ylabel('temp')
>
>         plt.savefig("test_plots/den_temp_xsweep.png")
>
> and getting the the following error:
>
> IOError: [Errno 2] No such file or directory:
> 'test_plots/den_temp_xsweep.png'
>
>
> Any suggestion on how to fix this error is highly appreciated.
>
> THanks
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160428/3fa58b53/attachment.htm>


More information about the yt-users mailing list