<div dir="ltr">Hi Doris,<div><br></div><div>The font properties of any of the annotations should be the same as the general font properties of the plot by default.  So when you changed the font size of the plot, it should equally affect the text and title annotations.  Like this:</div><div><br></div><div>import yt</div><div><span style="font-size:12.8px">ds= yt.load("output_00001/info_</span><span style="font-size:12.8px">00001.txt")</span></div><div><span style="font-size:12.8px">slc = yt.SlicePlot(ds, "z","density" ,window_size=7)</span></div><div><span style="font-size:12.8px">slc.set_font_size(20)</span></div><div><span style="font-size:12.8px">slc.annotate_title("Test")</span></div><div><span style="font-size:12.8px">slc.annotate_text((0.1, 0.1),"</span><span style="font-size:12.8px">timestep #:", coord_system='axis')</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Does this not work for you?  It works for me OK using the latest version on the "yt" branch (dev), but it should work in all versions.  Or am I misunderstanding your question?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">For more info on the annotations, check out this docs page and this recipe:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><a href="http://yt-project.org/docs/dev/visualizing/callbacks.html">http://yt-project.org/docs/dev/visualizing/callbacks.html</a></span><br></div><div><span style="font-size:12.8px"><a href="http://yt-project.org/docs/dev/cookbook/simple_plots.html#annotations-recipe">http://yt-project.org/docs/dev/cookbook/simple_plots.html#annotations-recipe</a></span></div><div><br></div><div>Cameron</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 19, 2015 at 2:38 PM, DORIS LEE <span dir="ltr"><<a href="mailto:dorislee@berkeley.edu" target="_blank">dorislee@berkeley.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi all,<br></div><div>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?</div><div>Thank you.</div><div><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">ds= yt.load("output_00001/info_00001.txt")</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">slc = yt.SlicePlot(ds, "z","density" ,window_size=7)</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">slc.set_font_size(20)</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">title=yt.visualization.plot_modifications.TitleCallback("title")</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">title(slc)</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># slc.annotate_title("Test")</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">slc.annotate_text((0,1),"timestep #:")</blockquote></blockquote></blockquote><div><br></div><div style="padding:0px;display:flex;color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:20px"><div style="padding:0.4em;max-width:calc(100% - 14ex);line-height:1.21429em"><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-wrap:break-word;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline;background-color:transparent"><span style="color:steelblue"><span style="color:darkgreen"><span style="color:rgb(196,160,0)"><span style="color:steelblue"><span style="color:darkgreen"><span style="color:steelblue"><span style="color:darkgreen"><pre style="overflow:auto;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><span style="color:darkred">---------------------------------------------------------------------------</span>
<span style="color:darkred">AttributeError</span>                            Traceback (most recent call last)
<span style="color:darkgreen"><ipython-input-63-fc5ce857c791></span> in <span style="color:steelblue"><module><span style="color:darkblue">()</span>
<span style="color:darkgreen">      3</span> slc<span style="color:rgb(196,160,0)">.</span>set_font_size<span style="color:rgb(196,160,0)">(</span><span>20</span><span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)"></span>
<span style="color:darkgreen">      4</span> title<span style="color:rgb(196,160,0)">=</span>yt<span style="color:rgb(196,160,0)">.</span>visualization<span style="color:rgb(196,160,0)">.</span>plot_modifications<span style="color:rgb(196,160,0)">.</span>TitleCallback<span style="color:rgb(196,160,0)">(</span><span style="color:darkblue">"title"</span><span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)"></span>
<span style="color:darkgreen">----> 5<span style="color:rgb(196,160,0)"> </span>title<span style="color:rgb(196,160,0)">(</span>slc<span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)"></span>
<span>      6</span> <span style="color:darkred"># slc.annotate_title("Test")</span><span style="color:rgb(196,160,0)"></span><span style="color:rgb(196,160,0)"></span>
<span>      7</span> slc<span style="color:rgb(196,160,0)">.</span>annotate_text<span style="color:rgb(196,160,0)">(</span><span style="color:rgb(196,160,0)">(</span><span style="color:steelblue">0</span><span style="color:rgb(196,160,0)">,</span><span style="color:steelblue">1</span><span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)">,</span><span style="color:darkblue">"timestep #:"</span><span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)"></span>

<span>/global/homes/d/dorislee/mypythonpackages/yt/visualization/plot_modifications.pyc</span> in <span style="color:steelblue">__call__<span style="color:darkblue">(self, plot)</span>
<span style="color:darkgreen">   1087</span> <span style="color:rgb(196,160,0)"></span>
<span style="color:darkgreen">   1088</span>     <span style="color:darkgreen">def</span> __call__<span style="color:rgb(196,160,0)">(</span>self<span style="color:rgb(196,160,0)">,</span>plot<span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)">:</span><span style="color:rgb(196,160,0)"></span>
<span style="color:darkgreen">-> 1089<span style="color:rgb(196,160,0)">         </span>plot<span style="color:rgb(196,160,0)">.</span>_axes<span style="color:rgb(196,160,0)">.</span>set_title<span style="color:rgb(196,160,0)">(</span>self<span style="color:rgb(196,160,0)">.</span>title<span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)"></span>
<span>   1090</span> <span style="color:rgb(196,160,0)"></span>
<span>   1091</span> <span>class</span> TimestampCallback<span style="color:rgb(196,160,0)">(</span>PlotCallback<span style="color:rgb(196,160,0)">)</span><span style="color:rgb(196,160,0)">:</span><span style="color:rgb(196,160,0)"></span>

<span style="color:darkred">AttributeError</span>: 'AxisAlignedSlicePlot' object has no attribute '_axes'</span></span></span></span></pre></span></span></span></span></span></span></span></pre></div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>Doris</div></font></span></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Cameron Hummels<div><span style="font-size:12.8000001907349px">NSF Postdoctoral Fellow</span></div><div><span style="font-size:12.8000001907349px">Department of Astronomy</span></div><div><span style="font-size:12.8000001907349px">California Institute of Technology</span><br></div><div><a href="http://chummels.org" style="font-size:12.8000001907349px" target="_blank">http://chummels.org</a><br></div></div></div></div>
</div>