<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><div><br></div><div><br></div><div>Doris</div></div>