Error with annotate_marker: Unknown property
Hi all, I'm trying to mark some positions with circle on slice and projection plot. But it can't recognize arguments used for specifying the property of the marker. For example:
p = SlicePlot(pf,'x','Density')
p.annotate_marker([0.5]*3,marker='o', plot_args={'color': 'red', 'mew': 5})
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 100, in newfunc args[0]._setup_plots() File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 886, in _setup_plots self.run_callbacks(f) File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 896, in run_callbacks callback(cbw) File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_modifications.py", line 777, in __call__ plot._axes.scatter(x,y, marker = self.marker, **self.plot_args) File "/home/cshi31/yt-x86_64/lib/python2.7/site-packages/matplotlib/axes.py", line 6123, in scatter collection.update(kwargs) File "/home/cshi31/yt-x86_64/lib/python2.7/site-packages/matplotlib/artist.py", line 670, in update raise AttributeError('Unknown property %s' % k) AttributeError: Unknown property mew mew is an alias for markeredgewidth. I also tried with 'markeredgewidth' but it gave the same error. Besides, 'mec', 'ms' also can't be recognized. Only 'color' works. Does anyone have a clue about this? Thanks very much. Chao
Hi Chao, For that callback, you're only allowed to specify keyword arguments accepted by matplotlib.axes.Axes.scatter: http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.scatter or Collection properties: http://matplotlib.org/api/collections_api.html#matplotlib.collections.Collec... I'd have to look closer to figure out which keyword corresponds to what you're looking for, but hopefully that leaves you enough information to figure out how to do what you're trying to do. -Nathan On Thu, Aug 1, 2013 at 3:53 PM, Chao Shi <shichao116@gmail.com> wrote:
Hi all,
I'm trying to mark some positions with circle on slice and projection plot. But it can't recognize arguments used for specifying the property of the marker. For example:
p = SlicePlot(pf,'x','Density')
p.annotate_marker([0.5]*3,marker='o', plot_args={'color': 'red', 'mew': 5})
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 100, in newfunc args[0]._setup_plots() File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 886, in _setup_plots self.run_callbacks(f) File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 896, in run_callbacks callback(cbw) File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_modifications.py", line 777, in __call__ plot._axes.scatter(x,y, marker = self.marker, **self.plot_args) File "/home/cshi31/yt-x86_64/lib/python2.7/site-packages/matplotlib/axes.py", line 6123, in scatter collection.update(kwargs) File "/home/cshi31/yt-x86_64/lib/python2.7/site-packages/matplotlib/artist.py", line 670, in update raise AttributeError('Unknown property %s' % k) AttributeError: Unknown property mew
mew is an alias for markeredgewidth. I also tried with 'markeredgewidth' but it gave the same error.
Besides, 'mec', 'ms' also can't be recognized. Only 'color' works.
Does anyone have a clue about this?
Thanks very much.
Chao
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Chao Shi -
Nathan Goldbaum