[yt-svn] commit/yt-doc: 15 new changesets
Bitbucket
commits-noreply at bitbucket.org
Tue Dec 13 12:39:25 PST 2011
15 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/changeset/9075a410cf5c/
changeset: 9075a410cf5c
user: jsoishi
date: 2011-12-08 01:58:01
summary: first pass at documenting the "manual plotting" interfaces.
affected #: 1 file
diff -r fc2b929c55734c3747a9ce11087a50af4f972f38 -r 9075a410cf5c7ce29ab1c059103895e4dd764891 source/visualizing/manual_plotting.rst
--- /dev/null
+++ b/source/visualizing/manual_plotting.rst
@@ -0,0 +1,42 @@
+.. _manual-plotting:
+
+Using the Manual Plotting Interface
+===================================
+
+Sometimes you need a lot of flexibility in creating plots. While the
+:class:`~yt.visualization.plot_collection.PlotCollection` provides a simple,
+easy to use object that can create nice looking, publication quality plots with
+a minimum of effort, there are often times when its ease of use conflicts with
+your need to change the font only on the x-axis, or whatever your
+need/desire/annoying coauthor requires. To that end, ``yt`` provides a number of
+ways of getting the raw data that goes into a plot to you in the form of a one
+or two dimensional dataset that you can plot using any plotting method you like.
+matplotlib or another python library are easiest, but these methods allow you to
+take your data and plot it in gnuplot, or any unnamed commercial plotting
+packages.
+
+.. _fixed-resolution-buffers:
+
+Slice, Projections, and other Images: The Fixed Resolution Buffer
+-----------------------------------------------------------------
+
+For slices and projects, ``yt`` provides a manual plotting interface based on
+the :class:`~yt.visualization.fixed_resolution.FixedResolutionBuffer` (hereafter
+referred to as FRB) object. Desipte its somewhat unwieldy name, at its heart, an
+FRB is a very simple object: it's essentially a porthole into your data. You
+specify a left edge, a right edge, and give it a data object.
+
+.. _manual-line-plots:
+
+Line Plots
+----------
+
+This is perhaps the simplest thing to do. ``yt`` provides a number of 1
+
+
+.. _manual-phase-plots
+
+Phase Plots
+-----------
+
+PhasePlotter...
https://bitbucket.org/yt_analysis/yt-doc/changeset/e26d9fd681b1/
changeset: e26d9fd681b1
user: jsoishi
date: 2011-12-08 02:02:09
summary: added slice plot to auto-generated docs
affected #: 1 file
diff -r 9075a410cf5c7ce29ab1c059103895e4dd764891 -r e26d9fd681b193a89cb8b2cab56c385af6a5c343 source/reference/api/plot_types.rst
--- a/source/reference/api/plot_types.rst
+++ b/source/reference/api/plot_types.rst
@@ -8,5 +8,6 @@
yt.visualization.plot_collection.PlotCollection
yt.visualization.plot_collection.PlotCollectionInteractive
+ yt.visualization.plot_types.SlicePlot
yt.visualization.fixed_resolution.FixedResolutionBuffer
yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer
https://bitbucket.org/yt_analysis/yt-doc/changeset/27fffd075db8/
changeset: 27fffd075db8
user: jsoishi
date: 2011-12-08 03:35:15
summary: at Matt's suggestion, I added the to_frb() method as a quick and easy way to create FRBs.
affected #: 1 file
diff -r e26d9fd681b193a89cb8b2cab56c385af6a5c343 -r 27fffd075db875f15b6050096630d85c1e4424ae source/visualizing/manual_plotting.rst
--- a/source/visualizing/manual_plotting.rst
+++ b/source/visualizing/manual_plotting.rst
@@ -23,16 +23,63 @@
For slices and projects, ``yt`` provides a manual plotting interface based on
the :class:`~yt.visualization.fixed_resolution.FixedResolutionBuffer` (hereafter
referred to as FRB) object. Desipte its somewhat unwieldy name, at its heart, an
-FRB is a very simple object: it's essentially a porthole into your data. You
-specify a left edge, a right edge, and give it a data object.
+FRB is a very simple object: it's essentially a window into your data: you give
+it a center and a width or a left and right edge, and an image resolution, and
+the FRB returns a fully pixelized image. The simplest way to
+generate an FRB is to use the ``.to_frb(width, resolution, center=None)`` method
+of any data two-dimensional data object:
+
+.. code-block:: python
+
+ import pylab as P
+ from yt.mods import *
+ pf = load("DD0010/moving7_0010")
+
+ v, c = pf.find_max('Density')
+ proj = pf.h.proj(0, 'Density')
+
+ width = 10./pf['kpc'] # we want a 10 kpc view
+ res = [1000, 1000] # create an image with 1000x1000 pixels
+ frb = proj.to_frb(width, res, center=c)
+
+ P.imshow(frb['Density'])
+ P.xlabel(r'$x \mathrm{kpc}$')
+ P.ylabel(r'$x \mathrm{furlongs}$')
+ P.savefig('my_perfect_figure.png')
+
+Simple! The FRB is really a very simple object that can be torn down and
+recreated quickly (in fact, this is how the reason GUI works when you pan and
+scan). Furthermore, you can add new fields in the same "window", and each of
+them can be plotted with their own zlimit. This is quite useful for creating a
+mosaic of the same region in space with Density, Temperature, and x-velocity,
+for example. Each of these quantities requires a substantially different set of
+limits.
+
+Here's a slightly more complex example:
+
+.. code-block:: python
+
+ from yt.mods import *
+ pf = load("RedshiftOutput0005")
+
+ width = (300, 'pc')
+ bfield_proj = pf.h.proj(direction, "MagneticEnergy", "Density")
+ density_proj = pf.h.proj(direction, "Density", "Density")
+
+ c = pf.h.find_max("Density")[1]
+ LE = (c[xax] - 0.5*width[0]/pf[width[1].lower()],
+ c[yax] - 0.5*width[0]/pf[width[1].lower()])
+ RE = (c[xax] + 0.5*width[0]/pf[width[1].lower()],
+ c[yax] + 0.5*width[0]/pf[width[1].lower()])
+ frb = FixedResolutionBuffer(proj, (LE[0],RE[0],LE[1],RE[1]), (512,512))
+
.. _manual-line-plots:
Line Plots
----------
-This is perhaps the simplest thing to do. ``yt`` provides a number of 1
-
+This is perhaps the simplest thing to do. ``yt`` provides a number of one dimensional objects, and these can easily
.. _manual-phase-plots
https://bitbucket.org/yt_analysis/yt-doc/changeset/8f47495d8cbf/
changeset: 8f47495d8cbf
user: jsoishi
date: 2011-12-08 18:31:16
summary: added line plotting and a first pass at Phase Plotting.
affected #: 1 file
diff -r 27fffd075db875f15b6050096630d85c1e4424ae -r 8f47495d8cbf03e7072d2db05facfe216e125c42 source/visualizing/manual_plotting.rst
--- a/source/visualizing/manual_plotting.rst
+++ b/source/visualizing/manual_plotting.rst
@@ -4,9 +4,9 @@
===================================
Sometimes you need a lot of flexibility in creating plots. While the
-:class:`~yt.visualization.plot_collection.PlotCollection` provides a simple,
-easy to use object that can create nice looking, publication quality plots with
-a minimum of effort, there are often times when its ease of use conflicts with
+:class:`~yt.visualization.plot_collection.PlotCollection` provides an easy to
+use object that can create nice looking, publication quality plots with a
+minimum of effort, there are often times when its ease of use conflicts with
your need to change the font only on the x-axis, or whatever your
need/desire/annoying coauthor requires. To that end, ``yt`` provides a number of
ways of getting the raw data that goes into a plot to you in the form of a one
@@ -15,6 +15,9 @@
take your data and plot it in gnuplot, or any unnamed commercial plotting
packages.
+Note that the hierarchy object associated with your snapshot file contains a
+list of plots you've made in ``pf.h.plots``.
+
.. _fixed-resolution-buffers:
Slice, Projections, and other Images: The Fixed Resolution Buffer
@@ -35,7 +38,7 @@
from yt.mods import *
pf = load("DD0010/moving7_0010")
- v, c = pf.find_max('Density')
+ c = pf.h.find_max('Density')[1]
proj = pf.h.proj(0, 'Density')
width = 10./pf['kpc'] # we want a 10 kpc view
@@ -43,19 +46,19 @@
frb = proj.to_frb(width, res, center=c)
P.imshow(frb['Density'])
- P.xlabel(r'$x \mathrm{kpc}$')
- P.ylabel(r'$x \mathrm{furlongs}$')
+ P.xlabel(r'$x\ \mathrm{kpc}$')
+ P.ylabel(r'$x\ \mathrm{furlongs}$')
P.savefig('my_perfect_figure.png')
-Simple! The FRB is really a very simple object that can be torn down and
-recreated quickly (in fact, this is how the reason GUI works when you pan and
-scan). Furthermore, you can add new fields in the same "window", and each of
-them can be plotted with their own zlimit. This is quite useful for creating a
-mosaic of the same region in space with Density, Temperature, and x-velocity,
-for example. Each of these quantities requires a substantially different set of
-limits.
+The FRB is a very small object that can be deleted and recreated quickly (in
+fact, this is how the reason GUI works when you pan and scan). Furthermore, you
+can add new fields in the same "window", and each of them can be plotted with
+their own zlimit. This is quite useful for creating a mosaic of the same region
+in space with Density, Temperature, and x-velocity, for example. Each of these
+quantities requires a substantially different set of limits.
-Here's a slightly more complex example:
+Here's a slightly more complex example, showing a few ``yt`` helper functions
+that can make setting up multiple axes with colorbars easier than it would be using only matplotlib (you're on your own with other plot libraries, though).
.. code-block:: python
@@ -79,11 +82,57 @@
Line Plots
----------
-This is perhaps the simplest thing to do. ``yt`` provides a number of one dimensional objects, and these can easily
+This is perhaps the simplest thing to do. ``yt`` provides a number of one dimensional objects, and these return a 1-D numpy array of their contents with direct dictionary acess. As a simple example, take a :class:`~yt.data_objects.data_containers.AMROrthoRayBase` object, which can be created from a hierarchy by calling ``pf.h.ortho_ray(axis, center)``.
-.. _manual-phase-plots
+.. code-block:: python
+
+ from yt.mods import *
+ import pylab as P
+ pf = load("RedshiftOutput0005")
+ c = pf.h.find_max("Density")[1]
+ ax = 0 # take a line cut along the x axis
+ ray = pf.h.ortho_ray(ax, (c[1], c[2])) # cutting through the y0,z0 such that we hit the max density
+
+ P.subplot(121)
+ P.plot(ray['x'], ray['Density'])
+ P.subplot(122)
+ P.plot(ray['x'], ray['Temperature'])
+
+ P.savefig("den_temp_xsweep.png")
+
+Of course, you'll likely want to do something more sophisticated than using the
+matplotlib defaults, but this gives the general idea.
+
+.. _manual-phase-plots:
Phase Plots
-----------
-PhasePlotter...
+Phase plots can be handled in a way similar to the FRB, but with a bit more
+metadata, reflecting the fact that phase plots require more information to
+construct. In order to create a phase plot, first you will create a
+:class:`yt.visualization.profile_plotter.PhasePlotter` object, giving it a data
+source and three fields: the x-axis field, the y-axis field, and the z field (that is, the color of the cells).
+
+.. code-block:: python
+
+ from yt.mods import *
+ import yt.visualization.phase_plotter as pp
+ import pylab as P
+
+ pf = load("RedshiftOutput0005")
+ c = pf.h.find_max("Density")[1]
+ radius = 10./pf['kpc']
+ sphere = pf.h.sphere(c,radius)
+
+ phase = pp.PhasePlotter(sph,'Density', 'Temperature','CellMassMsun')
+
+ fig, ax = phase.plot.to_mpl()
+ # sorry this is convoluted!
+ from yt.visualization._mpl_imports import FigureCanvasAgg
+
+ canvas = FigureCanvasAgg(fig)
+ canvas.print_figure('DensityTemperature_phase.png')
+
+
+
https://bitbucket.org/yt_analysis/yt-doc/changeset/bdd3949b4da9/
changeset: bdd3949b4da9
user: jsoishi
date: 2011-12-08 19:53:13
summary: added phase plot
affected #: 1 file
diff -r 8f47495d8cbf03e7072d2db05facfe216e125c42 -r bdd3949b4da90657708b1c959a3a8ca662d4e70e source/reference/api/plot_types.rst
--- a/source/reference/api/plot_types.rst
+++ b/source/reference/api/plot_types.rst
@@ -11,3 +11,4 @@
yt.visualization.plot_types.SlicePlot
yt.visualization.fixed_resolution.FixedResolutionBuffer
yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer
+ yt.visualization.profile_plotter.PhasePlotter
https://bitbucket.org/yt_analysis/yt-doc/changeset/e0e9bb8a336b/
changeset: e0e9bb8a336b
user: jsoishi
date: 2011-12-08 19:54:22
summary: a few corrections to the phase plot. started moving more advanced examples to the cookbook
affected #: 1 file
diff -r bdd3949b4da90657708b1c959a3a8ca662d4e70e -r e0e9bb8a336b7107d84681f3a9446f3ab04b9533 source/visualizing/manual_plotting.rst
--- a/source/visualizing/manual_plotting.rst
+++ b/source/visualizing/manual_plotting.rst
@@ -57,8 +57,9 @@
in space with Density, Temperature, and x-velocity, for example. Each of these
quantities requires a substantially different set of limits.
-Here's a slightly more complex example, showing a few ``yt`` helper functions
-that can make setting up multiple axes with colorbars easier than it would be using only matplotlib (you're on your own with other plot libraries, though).
+A more complex example, showing a few ``yt`` helper functions that can make
+setting up multiple axes with colorbars easier than it would be using only
+matplotlib can be found in the cookbook.
.. code-block:: python
@@ -117,16 +118,16 @@
.. code-block:: python
from yt.mods import *
- import yt.visualization.phase_plotter as pp
+ import yt.visualization.profile_plotter as pp
import pylab as P
-
- pf = load("RedshiftOutput0005")
+
+ pf = load("DD0010/moving7_0010")
c = pf.h.find_max("Density")[1]
radius = 10./pf['kpc']
- sphere = pf.h.sphere(c,radius)
-
+ sph = pf.h.sphere(c,radius)
+
phase = pp.PhasePlotter(sph,'Density', 'Temperature','CellMassMsun')
-
+
fig, ax = phase.plot.to_mpl()
# sorry this is convoluted!
from yt.visualization._mpl_imports import FigureCanvasAgg
@@ -134,5 +135,3 @@
canvas = FigureCanvasAgg(fig)
canvas.print_figure('DensityTemperature_phase.png')
-
-
https://bitbucket.org/yt_analysis/yt-doc/changeset/f8da7d5654ea/
changeset: f8da7d5654ea
user: jsoishi
date: 2011-12-08 20:27:41
summary: added get_multi_plot, as it's already referenced in the docs, but not added here
affected #: 1 file
diff -r e0e9bb8a336b7107d84681f3a9446f3ab04b9533 -r f8da7d5654ea4413c791d64c27417288d85b776b source/reference/api/plot_types.rst
--- a/source/reference/api/plot_types.rst
+++ b/source/reference/api/plot_types.rst
@@ -12,3 +12,4 @@
yt.visualization.fixed_resolution.FixedResolutionBuffer
yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer
yt.visualization.profile_plotter.PhasePlotter
+ yt.visualization.plot_collection.get_multi_plot
https://bitbucket.org/yt_analysis/yt-doc/changeset/b0d81df5d5ef/
changeset: b0d81df5d5ef
user: jsoishi
date: 2011-12-08 21:26:14
summary: converted to Redshift for examples; removed non-sensical complex FRB example
affected #: 1 file
diff -r f8da7d5654ea4413c791d64c27417288d85b776b -r b0d81df5d5ef7c4fc48ccfe1707fb374a7ef8e8a source/visualizing/manual_plotting.rst
--- a/source/visualizing/manual_plotting.rst
+++ b/source/visualizing/manual_plotting.rst
@@ -36,12 +36,12 @@
import pylab as P
from yt.mods import *
- pf = load("DD0010/moving7_0010")
+ pf = load("RedshiftOutput0005")
c = pf.h.find_max('Density')[1]
proj = pf.h.proj(0, 'Density')
- width = 10./pf['kpc'] # we want a 10 kpc view
+ width = 1.5/pf['mpc'] # we want a 1.5 mpc view
res = [1000, 1000] # create an image with 1000x1000 pixels
frb = proj.to_frb(width, res, center=c)
@@ -61,23 +61,6 @@
setting up multiple axes with colorbars easier than it would be using only
matplotlib can be found in the cookbook.
-.. code-block:: python
-
- from yt.mods import *
- pf = load("RedshiftOutput0005")
-
- width = (300, 'pc')
- bfield_proj = pf.h.proj(direction, "MagneticEnergy", "Density")
- density_proj = pf.h.proj(direction, "Density", "Density")
-
- c = pf.h.find_max("Density")[1]
- LE = (c[xax] - 0.5*width[0]/pf[width[1].lower()],
- c[yax] - 0.5*width[0]/pf[width[1].lower()])
- RE = (c[xax] + 0.5*width[0]/pf[width[1].lower()],
- c[yax] + 0.5*width[0]/pf[width[1].lower()])
- frb = FixedResolutionBuffer(proj, (LE[0],RE[0],LE[1],RE[1]), (512,512))
-
-
.. _manual-line-plots:
Line Plots
@@ -121,9 +104,9 @@
import yt.visualization.profile_plotter as pp
import pylab as P
- pf = load("DD0010/moving7_0010")
+ pf = load("RedshiftOutput0005")
c = pf.h.find_max("Density")[1]
- radius = 10./pf['kpc']
+ radius = 1.5/pf['mpc']
sph = pf.h.sphere(c,radius)
phase = pp.PhasePlotter(sph,'Density', 'Temperature','CellMassMsun')
https://bitbucket.org/yt_analysis/yt-doc/changeset/09837de705e3/
changeset: 09837de705e3
user: jsoishi
date: 2011-12-08 21:31:52
summary: tested scripts; minor mods
affected #: 1 file
diff -r b0d81df5d5ef7c4fc48ccfe1707fb374a7ef8e8a -r 09837de705e3f7079aaf1c921c84c5950ee29359 source/visualizing/manual_plotting.rst
--- a/source/visualizing/manual_plotting.rst
+++ b/source/visualizing/manual_plotting.rst
@@ -77,10 +77,13 @@
ax = 0 # take a line cut along the x axis
ray = pf.h.ortho_ray(ax, (c[1], c[2])) # cutting through the y0,z0 such that we hit the max density
- P.subplot(121)
+ P.subplot(211)
P.plot(ray['x'], ray['Density'])
- P.subplot(122)
+ P.ylabel('Density')
+ P.subplot(212)
P.plot(ray['x'], ray['Temperature'])
+ P.xlabel('x')
+ P.ylabel('Temperature')
P.savefig("den_temp_xsweep.png")
https://bitbucket.org/yt_analysis/yt-doc/changeset/bf38c77c3bac/
changeset: bf38c77c3bac
user: jsoishi
date: 2011-12-08 21:55:20
summary: added a few more plot types.
affected #: 1 file
diff -r 09837de705e3f7079aaf1c921c84c5950ee29359 -r bf38c77c3bac96d2ca108260c03ced75892e3f07 source/reference/api/plot_types.rst
--- a/source/reference/api/plot_types.rst
+++ b/source/reference/api/plot_types.rst
@@ -9,6 +9,9 @@
yt.visualization.plot_collection.PlotCollection
yt.visualization.plot_collection.PlotCollectionInteractive
yt.visualization.plot_types.SlicePlot
+ yt.visualization.plot_types.ProjectionPlot
+ yt.visualization.plot_types.PhasePlot
+ yt.visualization.plot_types.Profile1DPlot
yt.visualization.fixed_resolution.FixedResolutionBuffer
yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer
yt.visualization.profile_plotter.PhasePlotter
https://bitbucket.org/yt_analysis/yt-doc/changeset/b9bdb69b9a96/
changeset: b9bdb69b9a96
user: jsoishi
date: 2011-12-08 23:30:18
summary: slight rewording
affected #: 1 file
diff -r bf38c77c3bac96d2ca108260c03ced75892e3f07 -r b9bdb69b9a9698c59b61c9ffdbfadeaed552ad68 source/index.rst
--- a/source/index.rst
+++ b/source/index.rst
@@ -1,4 +1,4 @@
-yt Overview
+iyt Overview
===========
yt is a community-developed analysis and visualization toolkit for
@@ -79,7 +79,7 @@
</tr></table>
- <h2>Intermediate</h2>
+ <h2>Everyday yt</h2><table class="contentstable" align="center"><tr valign="top">
@@ -120,7 +120,7 @@
</span></p></td></tr></table>
- <h2>Advanced</h2>
+ <h2>Advanced Usage</h2><table class="contentstable" align="center"><tr valign="top"><td width="50%">
https://bitbucket.org/yt_analysis/yt-doc/changeset/b10ce6718382/
changeset: b10ce6718382
user: jsoishi
date: 2011-12-08 23:31:15
summary: oops. typo crept in.
affected #: 1 file
diff -r b9bdb69b9a9698c59b61c9ffdbfadeaed552ad68 -r b10ce6718382dd0cbaf6fbe6c5ded3a52f325f2e source/index.rst
--- a/source/index.rst
+++ b/source/index.rst
@@ -1,4 +1,4 @@
-iyt Overview
+yt Overview
===========
yt is a community-developed analysis and visualization toolkit for
https://bitbucket.org/yt_analysis/yt-doc/changeset/67b5b7784bab/
changeset: 67b5b7784bab
user: jsoishi
date: 2011-12-08 23:53:49
summary: updated for new install script.
affected #: 1 file
diff -r b10ce6718382dd0cbaf6fbe6c5ded3a52f325f2e -r 67b5b7784bab610a9228d933aa7a2af1606e7acf source/orientation/installing.rst
--- a/source/orientation/installing.rst
+++ b/source/orientation/installing.rst
@@ -41,6 +41,13 @@
environment to use yt. **You should follow these, or else yt may not work, or
may simply fail -- in unexpected ways!**
-One thing that we will use for the rest of the orientation is the variable
-``YT_DEST``, which is output at the end of the installation process. Be sure
-to set that, so that we can point to the sample data used in the next section.
+One thing that we will use for the rest of the orientation is the environment
+variable ``YT_DEST``, which is output at the end of the installation process.
+If you use the ``activate`` script as described in the instructions printed by
+the install script, you will be all set.
+
+If you'd like to do it manually, ``YT_DEST`` needs to point to the root of the
+directory containing the install. By default, this will be ``yt-<arch>``, where
+``<arch>`` is your machine's architecture (usually ``x86_64``). You will also
+need to set ``LD_LIBRARY_PATH`` and ``PYTHONPATH`` to contain ``$YT_PATH/lib`` and ``$YT_DEST/python2.7/site-packages``, respectively.
+
https://bitbucket.org/yt_analysis/yt-doc/changeset/4c48e8ff52f2/
changeset: 4c48e8ff52f2
user: jsoishi
date: 2011-12-09 00:05:47
summary: fixed to not confuse mac users.
affected #: 1 file
diff -r 67b5b7784bab610a9228d933aa7a2af1606e7acf -r 4c48e8ff52f20d8a724001a38c0397bd63508af0 source/orientation/installing.rst
--- a/source/orientation/installing.rst
+++ b/source/orientation/installing.rst
@@ -48,6 +48,6 @@
If you'd like to do it manually, ``YT_DEST`` needs to point to the root of the
directory containing the install. By default, this will be ``yt-<arch>``, where
-``<arch>`` is your machine's architecture (usually ``x86_64``). You will also
+``<arch>`` is your machine's architecture (usually ``x86_64`` or ``i386``). You will also
need to set ``LD_LIBRARY_PATH`` and ``PYTHONPATH`` to contain ``$YT_PATH/lib`` and ``$YT_DEST/python2.7/site-packages``, respectively.
https://bitbucket.org/yt_analysis/yt-doc/changeset/a4e2a32822ef/
changeset: a4e2a32822ef
user: MatthewTurk
date: 2011-12-13 21:39:12
summary: Merging from Jeff
affected #: 4 files
diff -r fef59d1e79f9e5eb709cf3c83fbf493c10c5ef00 -r a4e2a32822efc825df8b805b0f32f2e9cdac75cf source/index.rst
--- a/source/index.rst
+++ b/source/index.rst
@@ -79,7 +79,7 @@
</tr></table>
- <h2>Intermediate</h2>
+ <h2>Everyday yt</h2><table class="contentstable" align="center"><tr valign="top">
@@ -120,7 +120,7 @@
</span></p></td></tr></table>
- <h2>Advanced</h2>
+ <h2>Advanced Usage</h2><table class="contentstable" align="center"><tr valign="top"><td width="50%">
diff -r fef59d1e79f9e5eb709cf3c83fbf493c10c5ef00 -r a4e2a32822efc825df8b805b0f32f2e9cdac75cf source/orientation/installing.rst
--- a/source/orientation/installing.rst
+++ b/source/orientation/installing.rst
@@ -41,6 +41,13 @@
environment to use yt. **You should follow these, or else yt may not work, or
may simply fail -- in unexpected ways!**
-One thing that we will use for the rest of the orientation is the variable
-``YT_DEST``, which is output at the end of the installation process. Be sure
-to set that, so that we can point to the sample data used in the next section.
+One thing that we will use for the rest of the orientation is the environment
+variable ``YT_DEST``, which is output at the end of the installation process.
+If you use the ``activate`` script as described in the instructions printed by
+the install script, you will be all set.
+
+If you'd like to do it manually, ``YT_DEST`` needs to point to the root of the
+directory containing the install. By default, this will be ``yt-<arch>``, where
+``<arch>`` is your machine's architecture (usually ``x86_64`` or ``i386``). You will also
+need to set ``LD_LIBRARY_PATH`` and ``PYTHONPATH`` to contain ``$YT_PATH/lib`` and ``$YT_DEST/python2.7/site-packages``, respectively.
+
diff -r fef59d1e79f9e5eb709cf3c83fbf493c10c5ef00 -r a4e2a32822efc825df8b805b0f32f2e9cdac75cf source/reference/api/plot_types.rst
--- a/source/reference/api/plot_types.rst
+++ b/source/reference/api/plot_types.rst
@@ -8,5 +8,11 @@
yt.visualization.plot_collection.PlotCollection
yt.visualization.plot_collection.PlotCollectionInteractive
+ yt.visualization.plot_types.SlicePlot
+ yt.visualization.plot_types.ProjectionPlot
+ yt.visualization.plot_types.PhasePlot
+ yt.visualization.plot_types.Profile1DPlot
yt.visualization.fixed_resolution.FixedResolutionBuffer
yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer
+ yt.visualization.profile_plotter.PhasePlotter
+ yt.visualization.plot_collection.get_multi_plot
diff -r fef59d1e79f9e5eb709cf3c83fbf493c10c5ef00 -r a4e2a32822efc825df8b805b0f32f2e9cdac75cf source/visualizing/manual_plotting.rst
--- /dev/null
+++ b/source/visualizing/manual_plotting.rst
@@ -0,0 +1,123 @@
+.. _manual-plotting:
+
+Using the Manual Plotting Interface
+===================================
+
+Sometimes you need a lot of flexibility in creating plots. While the
+:class:`~yt.visualization.plot_collection.PlotCollection` provides an easy to
+use object that can create nice looking, publication quality plots with a
+minimum of effort, there are often times when its ease of use conflicts with
+your need to change the font only on the x-axis, or whatever your
+need/desire/annoying coauthor requires. To that end, ``yt`` provides a number of
+ways of getting the raw data that goes into a plot to you in the form of a one
+or two dimensional dataset that you can plot using any plotting method you like.
+matplotlib or another python library are easiest, but these methods allow you to
+take your data and plot it in gnuplot, or any unnamed commercial plotting
+packages.
+
+Note that the hierarchy object associated with your snapshot file contains a
+list of plots you've made in ``pf.h.plots``.
+
+.. _fixed-resolution-buffers:
+
+Slice, Projections, and other Images: The Fixed Resolution Buffer
+-----------------------------------------------------------------
+
+For slices and projects, ``yt`` provides a manual plotting interface based on
+the :class:`~yt.visualization.fixed_resolution.FixedResolutionBuffer` (hereafter
+referred to as FRB) object. Desipte its somewhat unwieldy name, at its heart, an
+FRB is a very simple object: it's essentially a window into your data: you give
+it a center and a width or a left and right edge, and an image resolution, and
+the FRB returns a fully pixelized image. The simplest way to
+generate an FRB is to use the ``.to_frb(width, resolution, center=None)`` method
+of any data two-dimensional data object:
+
+.. code-block:: python
+
+ import pylab as P
+ from yt.mods import *
+ pf = load("RedshiftOutput0005")
+
+ c = pf.h.find_max('Density')[1]
+ proj = pf.h.proj(0, 'Density')
+
+ width = 1.5/pf['mpc'] # we want a 1.5 mpc view
+ res = [1000, 1000] # create an image with 1000x1000 pixels
+ frb = proj.to_frb(width, res, center=c)
+
+ P.imshow(frb['Density'])
+ P.xlabel(r'$x\ \mathrm{kpc}$')
+ P.ylabel(r'$x\ \mathrm{furlongs}$')
+ P.savefig('my_perfect_figure.png')
+
+The FRB is a very small object that can be deleted and recreated quickly (in
+fact, this is how the reason GUI works when you pan and scan). Furthermore, you
+can add new fields in the same "window", and each of them can be plotted with
+their own zlimit. This is quite useful for creating a mosaic of the same region
+in space with Density, Temperature, and x-velocity, for example. Each of these
+quantities requires a substantially different set of limits.
+
+A more complex example, showing a few ``yt`` helper functions that can make
+setting up multiple axes with colorbars easier than it would be using only
+matplotlib can be found in the cookbook.
+
+.. _manual-line-plots:
+
+Line Plots
+----------
+
+This is perhaps the simplest thing to do. ``yt`` provides a number of one dimensional objects, and these return a 1-D numpy array of their contents with direct dictionary acess. As a simple example, take a :class:`~yt.data_objects.data_containers.AMROrthoRayBase` object, which can be created from a hierarchy by calling ``pf.h.ortho_ray(axis, center)``.
+
+.. code-block:: python
+
+ from yt.mods import *
+ import pylab as P
+ pf = load("RedshiftOutput0005")
+ c = pf.h.find_max("Density")[1]
+ ax = 0 # take a line cut along the x axis
+ ray = pf.h.ortho_ray(ax, (c[1], c[2])) # cutting through the y0,z0 such that we hit the max density
+
+ P.subplot(211)
+ P.plot(ray['x'], ray['Density'])
+ P.ylabel('Density')
+ P.subplot(212)
+ P.plot(ray['x'], ray['Temperature'])
+ P.xlabel('x')
+ P.ylabel('Temperature')
+
+ P.savefig("den_temp_xsweep.png")
+
+Of course, you'll likely want to do something more sophisticated than using the
+matplotlib defaults, but this gives the general idea.
+
+.. _manual-phase-plots:
+
+Phase Plots
+-----------
+
+Phase plots can be handled in a way similar to the FRB, but with a bit more
+metadata, reflecting the fact that phase plots require more information to
+construct. In order to create a phase plot, first you will create a
+:class:`yt.visualization.profile_plotter.PhasePlotter` object, giving it a data
+source and three fields: the x-axis field, the y-axis field, and the z field (that is, the color of the cells).
+
+.. code-block:: python
+
+ from yt.mods import *
+ import yt.visualization.profile_plotter as pp
+ import pylab as P
+
+ pf = load("RedshiftOutput0005")
+ c = pf.h.find_max("Density")[1]
+ radius = 1.5/pf['mpc']
+ sph = pf.h.sphere(c,radius)
+
+ phase = pp.PhasePlotter(sph,'Density', 'Temperature','CellMassMsun')
+
+ fig, ax = phase.plot.to_mpl()
+ # sorry this is convoluted!
+ from yt.visualization._mpl_imports import FigureCanvasAgg
+
+ canvas = FigureCanvasAgg(fig)
+ canvas.print_figure('DensityTemperature_phase.png')
+
Repository URL: https://bitbucket.org/yt_analysis/yt-doc/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list