[yt-svn] commit/yt: MatthewTurk: Merged in chummels/yt/yt-3.0 (pull request #1020)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Sun Jul 20 07:17:52 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/4e16b4a309f6/
Changeset: 4e16b4a309f6
Branch: yt-3.0
User: MatthewTurk
Date: 2014-07-20 16:17:45
Summary: Merged in chummels/yt/yt-3.0 (pull request #1020)
ProjectionPlots now include prepended "Projected" on color bar for whatever field is projected
Affected #: 1 file
diff -r 2f8bc1fbe63fa38f526a45d44a2da115c7e7487d -r 4e16b4a309f6a7ec765af203f815ec10f7604bb9 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -269,8 +269,9 @@
"""
frb = None
def __init__(self, data_source, bounds, buff_size=(800,800), antialias=True,
- periodic=True, origin='center-window', oblique=False,
- window_size=8.0, fields=None, fontsize=18, aspect=None, setup=False):
+ periodic=True, origin='center-window', oblique=False,
+ window_size=8.0, fields=None, fontsize=18, aspect=None,
+ setup=False):
if not hasattr(self, "ds"):
self.ds = data_source.ds
ts = self._initialize_dataset(self.ds)
@@ -914,6 +915,11 @@
colorbar_label = image.info['label']
+ # If we're creating a plot of a projection, change the displayed
+ # field name accordingly.
+ if hasattr(self, 'projected'):
+ colorbar_label = "$\\rm{Projected }$ %s" % colorbar_label
+
# Determine the units of the data
units = Unit(self.frb[f].units, registry=self.ds.unit_registry)
units = units.latex_representation()
@@ -1212,13 +1218,17 @@
self.ts = ts
ds = self.ds = ts[0]
axis = fix_axis(axis, ds)
+ # If a non-weighted integral projection, assure field-label reflects that
+ if weight_field is None and proj_style == "integrate":
+ self.projected = True
(bounds, center) = get_window_parameters(axis, center, width, ds)
if field_parameters is None: field_parameters = {}
proj = ds.proj(fields, axis, weight_field=weight_field,
center=center, data_source=data_source,
field_parameters = field_parameters, style = proj_style)
PWViewerMPL.__init__(self, proj, bounds, fields=fields, origin=origin,
- fontsize=fontsize, window_size=window_size, aspect=aspect)
+ fontsize=fontsize, window_size=window_size,
+ aspect=aspect)
if axes_unit is None:
axes_unit = get_axes_unit(width, ds)
self.set_axes_unit(axes_unit)
@@ -1419,6 +1429,9 @@
center_rot, ds, normal, oap_width, fields, interpolated,
weight=weight_field, volume=volume, no_ghost=no_ghost,
le=le, re=re, north_vector=north_vector)
+ # If a non-weighted, integral projection, assure field-label reflects that
+ if weight_field is None and OffAxisProj.proj_style == "integrate":
+ self.projected = True
# Hard-coding the origin keyword since the other two options
# aren't well-defined for off-axis data objects
PWViewerMPL.__init__(
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