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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Aug 28 08:15:58 PDT 2013


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/44feaad7b03f/
Changeset:   44feaad7b03f
Branch:      yt
User:        MatthewTurk
Date:        2013-08-23 00:06:09
Summary:     Mappable should have bounds set, and we should use UsedBins to find them.
Affected #:  1 file

diff -r 43940c6b177b36e0a69377f34cefad8ef6c6335c -r 44feaad7b03f6ef52e5b13c1304289ee556a42b1 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -144,9 +144,13 @@
 
         im = self.image
         if self.cbar.scale == 'log':
-            norm = mpl.matplotlib.colors.LogNorm()
+            norm = mpl.matplotlib.colors.LogNorm(
+                vmin = self.cbar.bounds[0],
+                vmax = self.cbar.bounds[1])
         else:
-            norm = mpl.matplotlib.colors.Normalize()
+            norm = mpl.matplotlib.colors.Normalize(
+                vmin = self.cbar.bounds[0],
+                vmax = self.cbar.bounds[1])
         if use_mesh:
             mappable = axes.pcolormesh(
                                   x_bins, y_bins, self.image, norm=norm,
@@ -161,6 +165,9 @@
                         norm = norm)
         cbar = figure.colorbar(mappable)
         cbar.set_label(self.cbar.title)
+        mappable.cmap.set_bad("w")
+        mappable.cmap.set_under("w")
+        mappable.cmap.set_over("w")
         if self.x_spec.title is not None:
             axes.set_xlabel(self.x_spec.title)
         if self.y_spec.title is not None:
@@ -305,12 +312,10 @@
 
         cbar = ColorbarSpec()
         cbar.title = self._current_field
-        if self.scale == 'log':
-            nz = (self.profile[self._current_field] > 0)
-            mi = self.profile[self._current_field][nz].min()
-        else:
-            mi = self.profile[self._current_field].min()
-        ma = self.profile[self._current_field].max()
+        nz = self.profile["UsedBins"]
+        mi = self.profile[self._current_field][nz].min()
+        ma = self.profile[self._current_field][nz].max()
+        print "BOUNDS", mi, ma
         cbar.bounds = (mi, ma)
         cbar.cmap = 'algae'
         cbar.scale = self.scale


https://bitbucket.org/yt_analysis/yt/commits/0b50e04eb397/
Changeset:   0b50e04eb397
Branch:      yt
User:        MatthewTurk
Date:        2013-08-23 00:08:37
Summary:     Oops.  Removing print statement.
Affected #:  1 file

diff -r 44feaad7b03f6ef52e5b13c1304289ee556a42b1 -r 0b50e04eb397c87596cefa7e4f128a89b829ebf6 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -315,7 +315,6 @@
         nz = self.profile["UsedBins"]
         mi = self.profile[self._current_field][nz].min()
         ma = self.profile[self._current_field][nz].max()
-        print "BOUNDS", mi, ma
         cbar.bounds = (mi, ma)
         cbar.cmap = 'algae'
         cbar.scale = self.scale


https://bitbucket.org/yt_analysis/yt/commits/e820b67495dc/
Changeset:   e820b67495dc
Branch:      yt
User:        MatthewTurk
Date:        2013-08-28 17:15:53
Summary:     Merged in MatthewTurk/yt (pull request #580)

Mappable should have bounds set, and we should use UsedBins to find them.
Affected #:  1 file

diff -r eda3e58c798068cdb94ecb0b2b172713fb52dd8f -r e820b67495dcc4c76181af1898918ebc102eebe4 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -144,9 +144,13 @@
 
         im = self.image
         if self.cbar.scale == 'log':
-            norm = mpl.matplotlib.colors.LogNorm()
+            norm = mpl.matplotlib.colors.LogNorm(
+                vmin = self.cbar.bounds[0],
+                vmax = self.cbar.bounds[1])
         else:
-            norm = mpl.matplotlib.colors.Normalize()
+            norm = mpl.matplotlib.colors.Normalize(
+                vmin = self.cbar.bounds[0],
+                vmax = self.cbar.bounds[1])
         if use_mesh:
             mappable = axes.pcolormesh(
                                   x_bins, y_bins, self.image, norm=norm,
@@ -161,6 +165,9 @@
                         norm = norm)
         cbar = figure.colorbar(mappable)
         cbar.set_label(self.cbar.title)
+        mappable.cmap.set_bad("w")
+        mappable.cmap.set_under("w")
+        mappable.cmap.set_over("w")
         if self.x_spec.title is not None:
             axes.set_xlabel(self.x_spec.title)
         if self.y_spec.title is not None:
@@ -305,12 +312,9 @@
 
         cbar = ColorbarSpec()
         cbar.title = self._current_field
-        if self.scale == 'log':
-            nz = (self.profile[self._current_field] > 0)
-            mi = self.profile[self._current_field][nz].min()
-        else:
-            mi = self.profile[self._current_field].min()
-        ma = self.profile[self._current_field].max()
+        nz = self.profile["UsedBins"]
+        mi = self.profile[self._current_field][nz].min()
+        ma = self.profile[self._current_field][nz].max()
         cbar.bounds = (mi, ma)
         cbar.cmap = 'algae'
         cbar.scale = self.scale

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