[Yt-svn] yt: Added user-defined markers to particle callback.

hg at spacepope.org hg at spacepope.org
Sun Apr 25 04:52:44 PDT 2010


hg Repository: yt
details:   yt/rev/b7e261fb3ab7
changeset: 1598:b7e261fb3ab7
user:      John Wise <jwise at astro.princeton.edu>
date:
Sun Apr 25 07:52:32 2010 -0400
description:
Added user-defined markers to particle callback.

diffstat:

 yt/raven/Callbacks.py |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 7e320eb41392 -r b7e261fb3ab7 yt/raven/Callbacks.py
--- a/yt/raven/Callbacks.py	Fri Apr 23 19:09:01 2010 -0700
+++ b/yt/raven/Callbacks.py	Sun Apr 25 07:52:32 2010 -0400
@@ -767,7 +767,7 @@
     _type_name = "particles"
     region = None
     _descriptor = None
-    def __init__(self, width, p_size=1.0, col='k', stride=1.0, ptype=None, stars_only=False, dm_only=False):
+    def __init__(self, width, p_size=1.0, col='k', marker='o', stride=1.0, ptype=None, stars_only=False, dm_only=False):
         """
         Adds particle positions, based on a thick slab along *axis* with a
         *width* along the line of sight.  *p_size* controls the number of
@@ -778,6 +778,7 @@
         self.width = width
         self.p_size = p_size
         self.color = col
+        self.marker = marker
         self.stride = stride
         self.ptype = ptype
         self.stars_only = stars_only
@@ -808,7 +809,7 @@
         px, py = self.convert_to_pixels(plot,
                     [reg[field_x][gg][::self.stride],
                      reg[field_y][gg][::self.stride]])
-        plot._axes.scatter(px, py, edgecolors='None',
+        plot._axes.scatter(px, py, edgecolors='None', marker=self.marker,
                            s=self.p_size, c=self.color)
         plot._axes.set_xlim(xx0,xx1)
         plot._axes.set_ylim(yy0,yy1)



More information about the yt-svn mailing list