<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 12, 2016 at 9:37 AM, Katharina Wollenberg <span dir="ltr"><<a href="mailto:k.wollenberg@stud.uni-heidelberg.de" target="_blank">k.wollenberg@stud.uni-heidelberg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Hi together, <div><br></div><div>I would like to relabel the y-axis of a profile plot. </div><div>I tried the “set_ylabel”-command but got the error message that ProfilePlot does not have this attribute. I also could not find an answer when skimming through the yt Cookbook. </div></div></blockquote><div><br></div><div>Hi Katharina,</div><div><br></div><div>You're right that ProfilePlot currently doesn't have an "easy" way to set the plot axes labels. Adding such a feature would be a reasonable thing to do as well as an easy first yt project if you're interested. If you're not interested, please feel free to file an issue with the feature request:</div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/issues/new">https://bitbucket.org/yt_analysis/yt/issues/new</a><br></div><div><br></div><div>As a workaround, you can access the matplotlib axes object and customize the plot from there using that interface. Here is a snippet that illustrates how to do this:</div><div><br></div><div>    plot = yt.ProfilePlot(ds.all_data(), ('gas', 'density'), ('gas', 'temperature'))</div><div>    ax = plot.axes[('gas', 'temperature')]</div><div>    ax.set_ylabel('my ylabel')</div><div>    plot.save()</div><div><br></div><div>Note that the keys of the plot.axes dictionary are the full field tuples, not the field name of the field plotted along the y axis. It's a dictionary because you are allowed to pass more than one y field to ProfilePlot, which will make more than one plot. You might take a look at plot.axes.keys() to see what I mean.</div><div><br></div><div>Hope that helps,</div><div><br></div><div>Nathan</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Can anyone help me with that?</div><div>Thanks in advance!</div><div><br></div><div>Regards, </div><div><br></div><div>Katharina<br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>------------------------------<wbr>-------------------------</div><div>Katharina Wollenberg</div><div>PhD Student in Astronomy</div><div><br></div><div>Zentrum für Astronomie der Universität Heidelberg (ZAH)</div><div>Institute of Theoretical Astrophysics (ITA)</div><div>Albert-Ueberle-Str. 2</div><div>69120 Heidelberg</div><div>Germany</div><div><br></div></div><br class="gmail-m_3282439374785104115Apple-interchange-newline"></div><br class="gmail-m_3282439374785104115Apple-interchange-newline"><br class="gmail-m_3282439374785104115Apple-interchange-newline">
</div>
<br></div></div><br>______________________________<wbr>_________________<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/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div></div>