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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Aug 1 11:31:42 PDT 2014


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/112935949c48/
Changeset:   112935949c48
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-08-01 19:41:00
Summary:     Making a few cookbook recipes work on matplotlib 1.3.1
Affected #:  3 files

diff -r ce522887be4e2fe7efefc7eabe109c706bd1a9af -r 112935949c48f1659f05d2f50dec58a9caa7e5f5 doc/source/cookbook/profile_with_variance.py
--- a/doc/source/cookbook/profile_with_variance.py
+++ b/doc/source/cookbook/profile_with_variance.py
@@ -18,11 +18,15 @@
                          extrema = {'radius': ((0.1, 'kpc'), (1000.0, 'kpc'))},
                          weight_field='cell_mass')
 
+# Create arrays to plot.
+radius = prof.x.value
+mean = prof['gas', 'velocity_magnitude'].value
+variance = prof.variance['gas', 'velocity_magnitude'].value
+
 # Plot the average velocity magnitude.
-plt.loglog(prof.x, prof['gas', 'velocity_magnitude'], label='Mean')
+plt.loglog(radius, mean, label='Mean')
 # Plot the variance of the velocity magnitude.
-plt.loglog(prof.x, prof.variance['gas', 'velocity_magnitude'],
-           label='Standard Deviation')
+plt.loglog(radius, variance, label='Standard Deviation')
 plt.xlabel('r [kpc]')
 plt.ylabel('v [cm/s]')
 plt.legend()

diff -r ce522887be4e2fe7efefc7eabe109c706bd1a9af -r 112935949c48f1659f05d2f50dec58a9caa7e5f5 doc/source/cookbook/rad_velocity.py
--- a/doc/source/cookbook/rad_velocity.py
+++ b/doc/source/cookbook/rad_velocity.py
@@ -33,8 +33,8 @@
 fig = plt.figure()
 ax = fig.add_subplot(111)
 
-ax.plot(rp0.x, rp0["radial_velocity"].in_units("km/s"),
-        rp1.x, rp1["radial_velocity"].in_units("km/s"))
+ax.plot(rp0.x.value, rp0["radial_velocity"].in_units("km/s").value,
+        rp1.x.value, rp1["radial_velocity"].in_units("km/s").value)
 
 ax.set_xlabel(r"$\mathrm{r\ (kpc)}$")
 ax.set_ylabel(r"$\mathrm{v_r\ (km/s)}$")

diff -r ce522887be4e2fe7efefc7eabe109c706bd1a9af -r 112935949c48f1659f05d2f50dec58a9caa7e5f5 doc/source/cookbook/radial_profile_styles.py
--- a/doc/source/cookbook/radial_profile_styles.py
+++ b/doc/source/cookbook/radial_profile_styles.py
@@ -19,7 +19,7 @@
 ax = fig.add_subplot(111)
 
 # Plot the density as a log-log plot using the default settings
-dens_plot = ax.loglog(rp.x, rp["density"])
+dens_plot = ax.loglog(rp.x.value, rp["density"].value)
 
 # Here we set the labels of the plot axes
 


https://bitbucket.org/yt_analysis/yt/commits/f06b454a1c62/
Changeset:   f06b454a1c62
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-08-01 20:31:35
Summary:     Merged in ngoldbaum/yt/yt-3.0 (pull request #1122)

Making a few cookbook recipes work on matplotlib 1.3.1
Affected #:  3 files

diff -r 38719b7efb0ef4ec8413486eac8bad4a13d95a26 -r f06b454a1c620f658ada1f635cf51ca21d6f7c5f doc/source/cookbook/profile_with_variance.py
--- a/doc/source/cookbook/profile_with_variance.py
+++ b/doc/source/cookbook/profile_with_variance.py
@@ -18,11 +18,15 @@
                          extrema = {'radius': ((0.1, 'kpc'), (1000.0, 'kpc'))},
                          weight_field='cell_mass')
 
+# Create arrays to plot.
+radius = prof.x.value
+mean = prof['gas', 'velocity_magnitude'].value
+variance = prof.variance['gas', 'velocity_magnitude'].value
+
 # Plot the average velocity magnitude.
-plt.loglog(prof.x, prof['gas', 'velocity_magnitude'], label='Mean')
+plt.loglog(radius, mean, label='Mean')
 # Plot the variance of the velocity magnitude.
-plt.loglog(prof.x, prof.variance['gas', 'velocity_magnitude'],
-           label='Standard Deviation')
+plt.loglog(radius, variance, label='Standard Deviation')
 plt.xlabel('r [kpc]')
 plt.ylabel('v [cm/s]')
 plt.legend()

diff -r 38719b7efb0ef4ec8413486eac8bad4a13d95a26 -r f06b454a1c620f658ada1f635cf51ca21d6f7c5f doc/source/cookbook/rad_velocity.py
--- a/doc/source/cookbook/rad_velocity.py
+++ b/doc/source/cookbook/rad_velocity.py
@@ -33,8 +33,8 @@
 fig = plt.figure()
 ax = fig.add_subplot(111)
 
-ax.plot(rp0.x, rp0["radial_velocity"].in_units("km/s"),
-        rp1.x, rp1["radial_velocity"].in_units("km/s"))
+ax.plot(rp0.x.value, rp0["radial_velocity"].in_units("km/s").value,
+        rp1.x.value, rp1["radial_velocity"].in_units("km/s").value)
 
 ax.set_xlabel(r"$\mathrm{r\ (kpc)}$")
 ax.set_ylabel(r"$\mathrm{v_r\ (km/s)}$")

diff -r 38719b7efb0ef4ec8413486eac8bad4a13d95a26 -r f06b454a1c620f658ada1f635cf51ca21d6f7c5f doc/source/cookbook/radial_profile_styles.py
--- a/doc/source/cookbook/radial_profile_styles.py
+++ b/doc/source/cookbook/radial_profile_styles.py
@@ -19,7 +19,7 @@
 ax = fig.add_subplot(111)
 
 # Plot the density as a log-log plot using the default settings
-dens_plot = ax.loglog(rp.x, rp["density"])
+dens_plot = ax.loglog(rp.x.value, rp["density"].value)
 
 # Here we set the labels of the plot axes

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

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