[yt-users] Adjusting fontsize on yt SlicePlot

DORIS LEE dorislee at berkeley.edu
Sat Sep 19 14:38:23 PDT 2015


Hi all,
I am trying to adjust the fontsize of the title and text of a yt SlicePlot.
It looks like TitleCallback could be used to make the plot setting same as
the font attributes set in the SlicePlot, but it errors because SlicePlot
doesn't have an axes.Is there a simpler way to feed in a plot_args diction
in the parameter for these plot annotate_title and annotate_text functions?
Thank you.


ds= yt.load("output_00001/info_00001.txt")
>>
>> slc = yt.SlicePlot(ds, "z","density" ,window_size=7)
>>
>> slc.set_font_size(20)
>>
>> title=yt.visualization.plot_modifications.TitleCallback("title")
>>
>> title(slc)
>>
>> # slc.annotate_title("Test")
>>
>> slc.annotate_text((0,1),"timestep #:")
>>
>>
---------------------------------------------------------------------------AttributeError
                           Traceback (most recent call
last)<ipython-input-63-fc5ce857c791> in <module>()      3
slc.set_font_size(20)      4
title=yt.visualization.plot_modifications.TitleCallback("title")---->
5 title(slc)      6 # slc.annotate_title("Test")      7
slc.annotate_text((0,1),"timestep #:")
/global/homes/d/dorislee/mypythonpackages/yt/visualization/plot_modifications.pyc
in __call__(self, plot)   1087    1088     def __call__(self,plot):->
1089         plot._axes.set_title(self.title)   1090    1091 class
TimestampCallback(PlotCallback):
AttributeError: 'AxisAlignedSlicePlot' object has no attribute '_axes'



Doris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150919/e135c46e/attachment.htm>


More information about the yt-users mailing list