[yt-svn] commit/yt: 3 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Nov 7 17:37:09 PST 2012
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/63f30562adb4/
changeset: 63f30562adb4
branch: yt
user: sskory
date: 2012-11-07 23:54:13
summary: Making the hop circle callback a bit prettier.
affected #: 1 file
diff -r a9f28dd0dcb90d1d75ec39844c3d36ecae989ee5 -r 63f30562adb4bd81f827ee5bfa72953ab3163234 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -809,6 +809,7 @@
def __call__(self, plot):
from matplotlib.patches import Circle
+ num = len(self.hop_output[:self.max_number])
for halo in self.hop_output[:self.max_number]:
size = halo.get_size()
if size < self.min_size or size > self.max_size: continue
@@ -825,18 +826,19 @@
(xi, yi) = (x_dict[plot.data.axis], y_dict[plot.data.axis])
(center_x,center_y) = self.convert_to_plot(plot,(center[xi], center[yi]))
- cir = Circle((center_x, center_y), radius, fill=False)
+ color = np.ones(3) * (0.3 * (num - halo.id)/ num) + 0.6
+ cir = Circle((center_x, center_y), radius, fill=False, color=color)
plot._axes.add_patch(cir)
if self.annotate:
if self.print_halo_size:
- plot._axes.text(center_x, center_y, "%s" % size,
- fontsize=self.font_size)
+ plot._axes.text(center_x+radius, center_y+radius, "%s" % size,
+ fontsize=self.font_size, color=color)
elif self.print_halo_mass:
- plot._axes.text(center_x, center_y, "%s" % halo.total_mass(),
- fontsize=self.font_size)
+ plot._axes.text(center_x+radius, center_y+radius, "%s" % halo.total_mass(),
+ fontsize=self.font_size, color=color)
else:
- plot._axes.text(center_x, center_y, "%s" % halo.id,
- fontsize=self.font_size)
+ plot._axes.text(center_x+radius, center_y+radius, "%s" % halo.id,
+ fontsize=self.font_size, color=color)
class HopParticleCallback(PlotCallback):
_type_name = "hop_particles"
https://bitbucket.org/yt_analysis/yt/changeset/f15825659f5a/
changeset: f15825659f5a
branch: yt
user: sskory
date: 2012-11-08 00:03:20
summary: Small mistake.
affected #: 1 file
diff -r 63f30562adb4bd81f827ee5bfa72953ab3163234 -r f15825659f5af3ce64aaad30062aff3603cbfb66 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -826,7 +826,7 @@
(xi, yi) = (x_dict[plot.data.axis], y_dict[plot.data.axis])
(center_x,center_y) = self.convert_to_plot(plot,(center[xi], center[yi]))
- color = np.ones(3) * (0.3 * (num - halo.id)/ num) + 0.6
+ color = np.ones(3) * (0.4 * (num - halo.id)/ num) + 0.6
cir = Circle((center_x, center_y), radius, fill=False, color=color)
plot._axes.add_patch(cir)
if self.annotate:
https://bitbucket.org/yt_analysis/yt/changeset/e56349a44a49/
changeset: e56349a44a49
branch: yt
user: MatthewTurk
date: 2012-11-08 02:37:08
summary: Merged in sskory/yt (pull request #329)
affected #: 1 file
diff -r 165822e82706aad84cb5bd658100c501823099ca -r e56349a44a49cec1a7c3af00300dd3daa566f964 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -809,6 +809,7 @@
def __call__(self, plot):
from matplotlib.patches import Circle
+ num = len(self.hop_output[:self.max_number])
for halo in self.hop_output[:self.max_number]:
size = halo.get_size()
if size < self.min_size or size > self.max_size: continue
@@ -825,18 +826,19 @@
(xi, yi) = (x_dict[plot.data.axis], y_dict[plot.data.axis])
(center_x,center_y) = self.convert_to_plot(plot,(center[xi], center[yi]))
- cir = Circle((center_x, center_y), radius, fill=False)
+ color = np.ones(3) * (0.4 * (num - halo.id)/ num) + 0.6
+ cir = Circle((center_x, center_y), radius, fill=False, color=color)
plot._axes.add_patch(cir)
if self.annotate:
if self.print_halo_size:
- plot._axes.text(center_x, center_y, "%s" % size,
- fontsize=self.font_size)
+ plot._axes.text(center_x+radius, center_y+radius, "%s" % size,
+ fontsize=self.font_size, color=color)
elif self.print_halo_mass:
- plot._axes.text(center_x, center_y, "%s" % halo.total_mass(),
- fontsize=self.font_size)
+ plot._axes.text(center_x+radius, center_y+radius, "%s" % halo.total_mass(),
+ fontsize=self.font_size, color=color)
else:
- plot._axes.text(center_x, center_y, "%s" % halo.id,
- fontsize=self.font_size)
+ plot._axes.text(center_x+radius, center_y+radius, "%s" % halo.id,
+ fontsize=self.font_size, color=color)
class HopParticleCallback(PlotCallback):
_type_name = "hop_particles"
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