Hi Libby,<br><br>Check out the powFormat in the plot_modifications repo.  It'll do that.<br><br>Britton<br><br><div class="gmail_quote">On Mon, Jun 6, 2011 at 11:36 AM, Elizabeth Harper-Clark <span dir="ltr"><<a href="mailto:h-clark@astro.utoronto.ca">h-clark@astro.utoronto.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Argh, sorry guys. First message didn't send as list didn't like the size of the attachment. here is the message:<br>
<br><br>Hi guys,<br><br>Quick question: how do I change how yt formats the 
number labels on the ticks on a colourbar? Rather than 0.0001, 0.001, 0.01, 0.1, and 1.0 x 1e28 I would rather the 
ticks were labelled 1e24, 1e25, 1e26, 1e27, and 1e28 (or even better 10 
with power superscripted)!<br>
<br>Thank you,<br>
<br>Libby<div><div></div><div class="h5"><br clear="all"><br clear="all"><br><br><div class="gmail_quote">On 6 June 2011 13:32, Elizabeth Harper-Clark <span dir="ltr"><<a href="mailto:h-clark@astro.utoronto.ca" target="_blank">h-clark@astro.utoronto.ca</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">ps, here is my script:<br><br><br>import matplotlib<br>matplotlib.use("Agg")<br>from yt.mods import *<br>

import pylab<br>import sys<br>import numpy as na<br><br>def _MyRadius(field, data):<br>    center = data.get_field_parameter("center")<br>
    dx = data["x"] - center[0]<br>    dy = data["y"] - center[1]<br>    dz = data["z"] - center[2]<br>    return na.sqrt(dx*dx + dy*dy + dz*dz)<br>add_field("Radius", function=_MyRadius, take_log=False, units='')<br>


<br>def _ConvertAccel(data):<br>    return data.convert("Length") / (data.convert("Time"))**2.0<br>def _RadiationAccelerationMagnitude(field, data):<br>    return ( (data["RadAccel1"])**2.0 + \<br>


             (data["RadAccel2"])**2.0 + \<br>             (data["RadAccel3"])**2.0 )**(1.0/2.0)<br>    #return ( (data["Density"])*0.0+1.e-28)<br>add_field("RadiationAccelerationMagnitude", function=_RadiationAccelerationMagnitude, take_log=False,convert_function=_ConvertAccel, units=r"\rm{cm}/\rm{s}^{2}")<br>


def _RadiationForceMagnitude(field, data):<br>    return ( data["RadiationAccelerationMagnitude"] * data["Density"] * data["CellVolume"])<br>add_field("RadiationForceMagnitude", function=_RadiationForceMagnitude, take_log=False, units=r"\rm{dynes}")<br>


<br>def _RadiationForce1(field, data):<br>    return ( (data["RadAccel1"] * data["Density"] * data["CellVolume"]))<br>add_field("RadiationForce1", function=_RadiationForce1, take_log=False, units=r"\rm{dynes}")<br>


def _RadiationForce2(field, data):<br>    return (( data["RadAccel2"] * data["Density"] * data["CellVolume"]))<br>add_field("RadiationForce2", function=_RadiationForce2, take_log=False, units=r"\rm{dynes}")<br>


def _RadiationForce3(field, data):<br>    return (( data["RadAccel3"] * data["Density"] * data["CellVolume"]))<br>add_field("RadiationForce3", function=_RadiationForce3, take_log=False, units=r"\rm{dynes}")<br>


<br><br><br>xc = 0.5<br>yc = 0.5<br>zc = 0.5<br>width = 179.2<br>frame_template = "aaSN/%s/RadPresProj_%s_%s"<br><br>folder = sys.argv[1]<br>starti = int(sys.argv[2])<br>endi = int(sys.argv[3])<br><br><br>Q = 1.e47<br>


RPSF = 2.0<br>nu = 21.62 * 1.6022e-12 # in ergs<br>print "Q:",Q<br>print "RPScaleFactor:", RPSF<br>print "nu:",nu<br><br>rho_min = 1.e24<br>rho_max = 5.e27<br><br>for i in range(starti, endi ,1): <br>


    print "a, i=",i<br>    pf = load("SciNet/%s/DD%04i/data%04i" % (folder, i, i))<br>    if pf is None: continue<br>    sp = pf.h.sphere([xc,yc,zc], 1.0)<br>    v, c = pf.h.find_max("Density")<br>


    print i, c<br>    print v,c<br>    pc = PlotCollection(pf, center=(xc,yc,zc))<br>    total = 0<br>    print "Initial time, code units =", pf["InitialTime"]<br>    for ax in range(0,1):<br>        p = pc.add_projection("RadiationForceMagnitude", ax, weight_field="Density")<br>


        p.set_log_field(True)<br>        p.set_cmap('Blues')<br>        p.set_zlim(1e24, 1e28)<br>        p.set_width(width,"pc")<br>        sp= pf.h.all_data()<br>        v1 = "RadiationForce2"<br>


        v2 = "RadiationForce3"<br>        p.modify["quiver"](v1, v2, 12)<br>        if na.any(pf.h.grid_particle_count):<br>            colours = sp["ParticleMassMsun"]<br>            p.modify["particles"](1.0, p_size=10.0, col='r', minimum_mass= 6e0)<br>


            print "          XXXXX Particles present XXXXX"<br>        Timemyr = pf["InitialTime"]*pf["years"]/1.e6<br>        p.modify["text"]((0.006,0.899),"%6.1f Myr" % (Timemyr), text_args = {'color':'w','fontsize':'30'})<br>


        p.modify["text"]((0.005,0.9),"%6.1f Myr" % (Timemyr), text_args = {'color':'b','fontsize':'30' })<br>        pc.save(frame_template % (sys.argv[1],ax,i), override=True, format="eps")<br>


<br><br><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>Elizabeth Harper-Clark MA MSci PhD<br><br><a href="http://www.astro.utoronto.ca/%7Eh-clark" target="_blank">www.astro.utoronto.ca/~h-clark</a><br><a href="mailto:h-clark@cita.utoronto.ca" target="_blank">h-clark@cita.utoronto.ca</a><br>

AIM: edphc1<br>MSN: <a href="mailto:edphc1@hotmail.com" target="_blank">edphc1@hotmail.com</a><br>Skype: eharperclark<br>Office phone: <a href="tel:416-978-5759" value="+14169785759" target="_blank">416-978-5759</a><br>
<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br>