Argh, sorry guys. First message didn't send as list didn't like the size of the attachment. here is the message:

Hi guys,

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)!

Thank you,

Libby

On 6 June 2011 13:32, Elizabeth Harper-Clark wrote:
ps, here is my script:

import matplotlib
matplotlib.use("Agg")
from yt.mods import *
import pylab
import sys
import numpy as na

center = data.get_field_parameter("center")
dx = data["x"] - center[0]
dy = data["y"] - center[1]
dz = data["z"] - center[2]
return na.sqrt(dx*dx + dy*dy + dz*dz)

def _ConvertAccel(data):
return data.convert("Length") / (data.convert("Time"))**2.0
#return ( (data["Density"])*0.0+1.e-28)
return ( data["RadiationAccelerationMagnitude"] * data["Density"] * data["CellVolume"])

return ( (data["RadAccel1"] * data["Density"] * data["CellVolume"]))
return (( data["RadAccel2"] * data["Density"] * data["CellVolume"]))
return (( data["RadAccel3"] * data["Density"] * data["CellVolume"]))

xc = 0.5
yc = 0.5
zc = 0.5
width = 179.2

folder = sys.argv[1]
starti = int(sys.argv[2])
endi = int(sys.argv[3])

Q = 1.e47
RPSF = 2.0
nu = 21.62 * 1.6022e-12 # in ergs
print "Q:",Q
print "RPScaleFactor:", RPSF
print "nu:",nu

rho_min = 1.e24
rho_max = 5.e27

for i in range(starti, endi ,1):
print "a, i=",i
pf = load("SciNet/%s/DD%04i/data%04i" % (folder, i, i))
if pf is None: continue
sp = pf.h.sphere([xc,yc,zc], 1.0)
v, c = pf.h.find_max("Density")
print i, c
print v,c
pc = PlotCollection(pf, center=(xc,yc,zc))
total = 0
print "Initial time, code units =", pf["InitialTime"]
for ax in range(0,1):
p.set_log_field(True)
p.set_cmap('Blues')
p.set_zlim(1e24, 1e28)
p.set_width(width,"pc")
sp= pf.h.all_data()
p.modify["quiver"](v1, v2, 12)
if na.any(pf.h.grid_particle_count):
colours = sp["ParticleMassMsun"]
p.modify["particles"](1.0, p_size=10.0, col='r', minimum_mass= 6e0)
print "          XXXXX Particles present XXXXX"
Timemyr = pf["InitialTime"]*pf["years"]/1.e6
p.modify["text"]((0.006,0.899),"%6.1f Myr" % (Timemyr), text_args = {'color':'w','fontsize':'30'})
p.modify["text"]((0.005,0.9),"%6.1f Myr" % (Timemyr), text_args = {'color':'b','fontsize':'30' })
pc.save(frame_template % (sys.argv[1],ax,i), override=True, format="eps")

--
Elizabeth Harper-Clark MA MSci PhD

www.astro.utoronto.ca/~h-clark
h-clark@cita.utoronto.ca
AIM: edphc1
MSN: edphc1@hotmail.com
Skype: eharperclark
Office phone: 416-978-5759