[yt-svn] commit/yt-doc: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Tue Jul 24 15:38:54 PDT 2012


2 new commits in yt-doc:


https://bitbucket.org/yt_analysis/yt-doc/changeset/e5cecbc0dc46/
changeset:   e5cecbc0dc46
user:        ngoldbaum
date:        2012-07-24 23:39:11
summary:     Adding simple_slice_with_multiple_fields.py
affected #:  1 file

diff -r da15f2508c442483be477334569f544b672a1f3f -r e5cecbc0dc463a8303534f3020f30feae1a1fe7c source/cookbook/simple_slice_with_multiple_fields.py
--- /dev/null
+++ b/source/cookbook/simple_slice_with_multiple_fields.py
@@ -0,0 +1,8 @@
+from yt.mods import *
+
+# Load the dataset
+pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+
+# Create density slices of several fields along the x axis
+SlicePlot(pf, 'x', ['Density','Temperature','Pressure','VorticitySquared'], 
+          width = (100.0, 'kpc')).save()



https://bitbucket.org/yt_analysis/yt-doc/changeset/05087e70403d/
changeset:   05087e70403d
user:        ngoldbaum
date:        2012-07-25 00:16:19
summary:     Adding an example that shows how to access the underlying figure and axes objects.
affected #:  1 file

diff -r e5cecbc0dc463a8303534f3020f30feae1a1fe7c -r 05087e70403d73a4f71ee34278c1d4418d9f5da9 source/cookbook/simple_slice_matplotlib_example.py
--- /dev/null
+++ b/source/cookbook/simple_slice_matplotlib_example.py
@@ -0,0 +1,28 @@
+from yt.mods import *
+
+# Load the dataset.
+pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
+
+# Create a slice object
+slc = SlicePlot(pf,'x','Density',width=(100.0,'kpc'))
+
+# Get a reference to the matplotlib axes object for the plot
+ax = slc.plots['Density'].axes
+
+# Let's adjust the x axis tick labels
+for label in ax.xaxis.get_ticklabels():
+    label.set_color('red')
+    label.set_rotation(45)
+    label.set_fontsize(16)
+
+# Get a reference to the matplotlib figure object for the plot
+fig = slc.plots['Density'].figure
+
+rect = (0.2,0.2,0.2,0.2)
+new_ax = fig.add_axes(rect)
+
+n, bins, patches = new_ax.hist(na.random.randn(1000)+20, 50,
+    facecolor='yellow', edgecolor='yellow')
+new_ax.set_xlabel('Dinosaurs per furlong')
+
+slc.save()

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