I've just made script for displaying discrete data clustered in boxes
on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's
seem a reasonable size on screen but when I render it to file they
look huge so I'd like to reduce their size. Does anyone know how this
is done?
Sorry a rather stupid question as there are '.'s available. Although I
wouldn't mind knowing if it's possible to tinker with the sizes of
'o's and '.'s.
I've just made script for displaying discrete data clustered in boxes
on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's
seem a reasonable size on screen but when I render it to file they
look huge so I'd like to reduce their size. Does anyone know how this
is done?
On Fri, Feb 26, 2010 at 6:35 PM, mikey <[email protected]...> wrote:
Sorry a rather stupid question as there are '.'s available. Although I
wouldn't mind knowing if it's possible to tinker with the sizes of
'o's and '.'s.
# untested, might have typos ~~~~
import numpy as np
import matplotlib.pyplot as pl
x = np.random.randn(20)
fig = pl.figure()
ax = pl.add_subplot(1,1,1)
# you can specify the marker size two ways directly:
ax.plot(x, 'ko', markersize=4) # size in points
ax.plot(x, 'bs', ms=4) % ms is just an alias for markersize
# or you can specify it after the plotting:
X = ax.plot(x, 'ko') # X is a *list* of line2d objects...
X[0].set_markersize(4) # set_ms works too
# or...
pl.setp(Y, markersize=4) # again, ms works.
# ~~~~~~~~
For a list of all the properties you can tweak, type:
pl.getp(<object>)
HTH,
-paul
···
-----Original Message-----
From: mikey [mailto:abc.mikey@…982…]
Sent: Friday, February 26, 2010 4:29 PM
To: [email protected]
Subject: [Matplotlib-users] Change the size of the plotted 'o's ?
Hi there,
I've just made script for displaying discrete data clustered in boxes
on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's
seem a reasonable size on screen but when I render it to file they
look huge so I'd like to reduce their size. Does anyone know how this
is done?