[yt-users] p.modify["point"]
Elizabeth Tasker
tasker at astro1.sci.hokudai.ac.jp
Sun Jul 8 16:36:57 PDT 2012
This is the full error spiel. If I comment out the point line, then it's fine.
Elizabeth
TypeError Traceback (most recent call last)
/home/tasker/yt/src/yt-hg/scripts/iyt in <module>()
----> 1 execfile("cloud_tracking.py")
/home/tasker/yt/src/yt-hg/scripts/iyt in <module>()
224
225
--> 226 pc.save("%s_tracking" % (fn))
227
228
/home/tasker/yt/src/yt-hg/yt/visualization/plot_collection.pyc in save(self, basename, format, override, force_save)
186 for plot in self.plots:
187 fn.append(plot.save_image(basename, format=format,
--> 188 override=override, force_save=force_save))
189 mylog.info("Saved %s", fn[-1])
190 if ytcfg.getboolean("yt", "__withinreason"):
/home/tasker/yt/src/yt-hg/yt/visualization/plot_types.pyc in save_image(self, prefix, format, override, force_save, figure_canvas)
107 prefix.
108 """
--> 109 self._redraw_image()
110 if not override:
111 self._generate_prefix(prefix)
/home/tasker/yt/src/yt-hg/yt/visualization/plot_types.pyc in _redraw_image(self, *args)
421 self.norm.autoscale(na.array((newmin,newmax), dtype='float64'))
422 self._reset_image_parameters()
--> 423 self._run_callbacks()
424
425 def _reset_image_parameters(self):
/home/tasker/yt/src/yt-hg/yt/visualization/plot_types.pyc in _run_callbacks(self)
261 self._axes.texts = []
262 for cb in self._callbacks:
--> 263 cb(self)
264
265 def set_label(self, label):
/home/tasker/yt/src/yt-hg/yt/visualization/plot_modifications.pyc in __call__(self, plot)
640 def __call__(self, plot):
641 x,y = self.convert_to_pixels(plot, self.pos)
--> 642 plot._axes.text(x, y, self.text, **self.text_args)
643
644 class MarkerAnnotateCallback(PlotCallback):
TypeError: text() argument after ** must be a mapping, not NoneType
On Jul 9, 2012, at 8:04 AM, Elizabeth Tasker wrote:
> Hi Matt,
>
> No, the marker works fine. By itself, it is no problem.
>
> Elizabeth
>
>
> On 2012-07-09, at 2:25 AM, Matthew Turk wrote:
>
>> Hi Elizabeth,
>>
>> It looks like the error might be in marker (But it's tough to tell
>> from the one error) so maybe try:
>>
>> p.modify["marker"](t1clouds[c]['position'], plot_args = dict(marker = 'o')
>>
>> -Matt
>>
>> On Sun, Jul 8, 2012 at 12:04 PM, Elizabeth Tasker
>> <tasker at astro1.sci.hokudai.ac.jp> wrote:
>>> Hi,
>>>
>>> I'm trying to add text to a particular point in my slice. I've got:
>>>
>>> position = na.array([20.2, 13.8, 16.0])
>>> pc = PlotCollection(pf, center=position)
>>> p = pc.add_projection("Density", 2)
>>> p.set_width(2, 'kpc')
>>> for c in range(len(t1clouds)):
>>> r = abs(t1clouds[c]['position']-position)
>>> if r[0] < 1.0 and r[1] < 1.0:
>>> p.modify["point"](t1clouds[c]['position'], str(t1clouds[c]['track']))
>>> p.modify["marker"](t1clouds[c]['position'], marker='o')
>>>
>>>
>>> pc.save("%s_tracking" % (fn))
>>>
>>>
>>> But python complains with:
>>>
>>>
>>> TypeError: text() argument after ** must be a mapping, not NoneType
>>>
>>>
>>> Did I call the modifier incorrectly?
>>>
>>> Elizabeth
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
More information about the yt-users
mailing list