[yt-users] SphereCallback
Brian Crosby
crosby.bd at gmail.com
Wed Sep 22 12:40:44 PDT 2010
Stephen,
This worked almost perfectly, except that the 'fill' feature seems to be broken. No matter how I set it, it always plots a filled in circle. Is there some way to get around this?
Thanks,
Brian
On Sep 18, 2010, at 11:09 PM, Stephen Skory wrote:
> Hi Brian,
>
>> Hello everyone, could someone tell me how to plot a sphere in a color other than
>>
>> black? I've got this much working:
>> p.modify['sphere']((x,y,z), radius, )
>> to plot a sphere at x, y, z of radius radius, but I cannot seem to succeed in
>> changing the color.
>
>
> It's not obvious how to do this. You need to make a dict with the properties of
> the circle you want, taken from here:
>
> http://matplotlib.sourceforge.net/api/artist_api.html?highlight=circle#matplotlib.patches.Circle
>
> (if broken above)
> http://tinyurl.com/2vtbwqr
>
> Here's example of a session where I made the attached image.
>
> In [1]: pf = load("data0111")
>
> In [2]: pc = PlotCollection(pf)
> yt INFO 2010-09-18 21:04:13,555 Getting the binary hierarchy
> yt INFO 2010-09-18 21:04:13,569 Finished with binary hierarchy
> reading
> yt.lagos INFO 2010-09-18 21:04:13,842 Max Value is 2.81423e-26 at
> 0.5100097656250000 0.4914550781250000 0.5051269531250000 in grid EnzoGrid_0060
> at level 4 (8, 8, 10)
> yt INFO 2010-09-18 21:04:13,842 Created plot collection with
> default plot-center = [0.510009765625, 0.491455078125, 0.505126953125]
>
> In [3]: pc.add_projection("Density", 0)
> Out[3]: <yt.raven.PlotTypes.ProjectionPlot object at 0x5e6dad0>
>
> In [4]: d = {'facecolor':'blue', 'edgecolor':'green', 'fill':True}
>
> In [5]: pc.plots[-1].modify['sphere']([0.3,0.3,0.3], 0.1, circle_args=d)
> Out[5]: 0
>
> In [6]: pc.save()
> yt INFO 2010-09-18 21:04:40,063 Saved
> data0111_Projection_x_Density.png
> Out[6]: ['data0111_Projection_x_Density.png']
>
>
>
>
> _______________________________________________________
> sskory at physics.ucsd.edu o__ Stephen Skory
> http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student
> ________________________________(_)_\(_)_______________
> <data0111_Projection_x_Density.png>_______________________________________________
> 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