<div dir="ltr"><div><div>Ah, then you need to simply change the tick formatter. Here are some examples:<br><br><a href="https://matplotlib.org/devdocs/gallery/ticks_and_spines/tick-formatters.html">https://matplotlib.org/devdocs/gallery/ticks_and_spines/tick-formatters.html</a><br><br></div>Cheers!<br></div>Ben Root<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 8, 2017 at 11:09 AM, Slavin, Jonathan <span dir="ltr"><<a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.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 class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi Ben,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">The issue with that is that I want to retain the logarithmic binning. If I change the xscale/yscale to log with the binning as set up now, then it will try to scale the log values logarithmically.  So I still want the axes to be scaled in the same way, I just want the labeling of the axes to be different.  Is that clear?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Jon</div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 8, 2017 at 10:25 AM, Benjamin Root <span dir="ltr"><<a href="mailto:ben.v.root@gmail.com" target="_blank">ben.v.root@gmail.com</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><div>You can do `ax.set_xscale('log')` to set the x-axis to log scale and similarly for the y-axis. It'll automatically make the tick labels make sense. Also, you won't need to pass in the log10 of n or P, matplotlib will handle all of that for you.<br><br></div>Cheers!<br></div>Ben Root<br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_4241291215257161962h5">On Wed, Nov 8, 2017 at 10:10 AM, Slavin, Jonathan <span dir="ltr"><<a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_4241291215257161962h5"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">Hi,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">I'm wondering if anyone knows of a good way to relabel axes for a particular case I'm dealing with. I'm making a 2D histogram, using hist2d of course.  The thing is that for my case, where I'm plotting the density vs. pressure for results from a hydro run, it makes more sense to use the log of the quantities as the inputs for hist2d.  So then I need to give the log of the density and pressure to hist2d. This works fine for making the histogram, but then the axes are labelled with log10(n), log10(P).  I'd prefer to have the axes labelled as for a logarithmic plot, so instead of say 4.0, 10^4.  Is there a simple way of doing that. I'm pretty sure I can just specify by hand the ticks and tick labels, though that's kind of a pain. Any help would be appreciated.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Regards,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Jon</div><span class="m_4241291215257161962m_8339553970280037930HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_4241291215257161962m_8339553970280037930m_-6954082772003115497gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">______________________________<wbr>__________________________<br>Jonathan D. Slavin                 Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>       60 Garden Street, MS 83<br>phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981</a>       Cambridge, MA 02138-1516<br>cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035</a>             USA<br>______________________________<wbr>__________________________<br><br></div></div></div></div>
</font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/matplotlib-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_4241291215257161962gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">______________________________<wbr>__________________________<br>Jonathan D. Slavin                 Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>       60 Garden Street, MS 83<br>phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981</a>       Cambridge, MA 02138-1516<br>cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035</a>             USA<br>______________________________<wbr>__________________________<br><br></div></div></div></div>
</div></div></div></div>
</blockquote></div><br></div>