hi there, I stumbled into yet another problem, see script attached. Now
there are 10 pixels and 10 label values on each axis, but I get only
half the ticks, and as a result half the labels get discarded... How can
I specify the number of ticks it uses?
Note that I could use plt.pcolor(np.array(EMINS),np.array(ROIS),d) and
at least the labelling would be correct, but the pixels are now more or
less wide depending on the interval between values, which was not
intended....
thanks a lot in advance for your help,
Johann
Johann Cohen-Tanugi wrote:
Hello, how can I center axis tick labels, so that the labels ends up at
the center between 2 ticks.
thanks in advance,
Johann
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
import matplotlib.pyplot as plt
import numpy as np
d = np.array([[ 157.95277364, 153.43173695, 146.13158977, 141.54839658,
144.52643315, 124.31540514, 121.25041319, 94.97418322,
64.74824341, 27.69885997],
[ 166.42505119, 161.6584763 , 152.96285478, 149.94707942,
148.95740797, 135.38872561, 131.60396144, 104.24714341,
69.36953504, 28.22984027],
[ 180.18354975, 175.80862266, 163.19215239, 161.79956642,
157.49777483, 143.04049195, 144.89181555, 116.46328816,
84.029379 , 31.41834047],
[ 189.67039827, 186.61746661, 177.39989771, 178.12248221,
172.37834168, 152.80223899, 164.45528247, 141.6235974 ,
115.46930152, 61.55211961],
[ 157.09501131, 154.46700398, 145.35801984, 151.56479068,
141.09453561, 130.09545669, 135.6759625 , 120.79901256,
98.09147933, 59.62847031],
[ 141.05859093, 137.90739078, 128.05909052, 136.6963394 ,
134.19701193, 129.56047371, 131.74742858, 119.75074075,
98.92957831, 68.68764481],
[ 125.13744117, 123.38731079, 123.93182985, 126.59952041,
127.12588879, 124.92796151, 132.8109024 , 133.95243655,
121.58352334, 99.01494134],
[ 82.49855115, 82.5109548 , 83.65697445, 85.33888768,
83.28319399, 83.81724338, 93.04441865, 91.65137654,
86.05573836, 75.8860952 ],
[ 55.3082678 , 56.98568928, 54.49724808, 52.80536213,
52.41055057, 56.78071926, 62.01649764, 65.72762368,
56.78034563, 53.16029942],
[ 23.8194714 , 24.16684446, 22.86100321, 23.87513858,
22.2958795 , 27.16573087, 28.94610545, 38.55528517,
43.05176998, 41.46975149]])
ROIS=[1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1]
EMINS=[100,125,150,175,200,250,300,500,700,1000]
fig = plt.figure()
ax = fig.add_subplot(111)
plt.pcolor(d)
ax.set_xticklabels(EMINS)
plt.xlabel("Emin(MeV)")
ax.set_yticklabels(ROIS)
plt.ylabel("Roi(deg)")
plt.colorbar()
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users