[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Feb 2 10:43:32 PST 2017
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/b9f10481cf95/
Changeset: b9f10481cf95
Branch: yt
User: ngoldbaum
Date: 2017-02-02 16:35:08+00:00
Summary: make set_background_color work correctly with matplotlib colormaps
Affected #: 1 file
diff -r 22ce92624c6f5d630852e58f427262dd516f3d82 -r b9f10481cf956148a5088ec576a7745773045471 yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -313,8 +313,11 @@
actual_field = self.data_source._determine_fields(field)[0]
if color is None:
cmap = self._colormaps[actual_field]
- if isinstance(cmap, string_types):
- cmap = yt_colormaps[cmap]
+ if isinstance(cmap, string_types):
+ try:
+ cmap = yt_colormaps[cmap]
+ except KeyError:
+ cmap = getattr(matplotlib.cm, cmap)
color = cmap(0)
if LooseVersion(matplotlib.__version__) < LooseVersion("2.0.0"):
self.plots[actual_field].axes.set_axis_bgcolor(color)
https://bitbucket.org/yt_analysis/yt/commits/13c1ee22f924/
Changeset: 13c1ee22f924
Branch: yt
User: jzuhone
Date: 2017-02-02 18:43:24+00:00
Summary: Merged in ngoldbaum/yt (pull request #2513)
make set_background_color work correctly with matplotlib colormaps. Closes #1317
Approved-by: Hsi-Yu Schive
Approved-by: John ZuHone
Affected #: 1 file
diff -r 061e062e2b4cd7299dc6e942bf771a6b6a4c236b -r 13c1ee22f924f988c6dfc68c9b64d6e9acdebfd2 yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -313,8 +313,11 @@
actual_field = self.data_source._determine_fields(field)[0]
if color is None:
cmap = self._colormaps[actual_field]
- if isinstance(cmap, string_types):
- cmap = yt_colormaps[cmap]
+ if isinstance(cmap, string_types):
+ try:
+ cmap = yt_colormaps[cmap]
+ except KeyError:
+ cmap = getattr(matplotlib.cm, cmap)
color = cmap(0)
if LooseVersion(matplotlib.__version__) < LooseVersion("2.0.0"):
self.plots[actual_field].axes.set_axis_bgcolor(color)
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