[yt-users] Query

Geoffrey So gsiisg at gmail.com
Mon Jul 2 03:36:50 PDT 2012


You can use numpy's loadtxt() to load columns of data into memory and use
the plot function to plot them.
http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html

so in yt it would look something like

from yt.mods import *
...some yt stuff that saves to myfile.txt...

import numpy as na
col1, col2 = na.loadtxt("myfile.txt", usecols=(0,1))
pylab.plot(col1,col2)

This is assuming your ASCII data is in columns.  Essentially starting from
import numpy, this is just a matplotlib script which can be separate from
the yt stuff above.

From
G.S.

On Mon, Jul 2, 2012 at 12:50 AM, Amol Holkundkar <amol.h at gmx.com> wrote:

> Dear All,
>
> How we can use yt to plot ASCII files like gnuplot. Any simple example
> will be really appreciated.
>
> Thanks,
>
> Regards
> Amol
>
> _______________________________________________
> 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/20120702/a955470d/attachment.html>


More information about the yt-users mailing list