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?

Regards,

Mikey

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.

Thanks,

Mikey

···

On 27 February 2010 00:29, mikey <abc.mikey@...982...> wrote:

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?

Regards,

Mikey

See the "markersize" parameter

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot

JDH

···

On Fri, Feb 26, 2010 at 6:35 PM, mikey <abc.mikey@...982...> 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.

Mike,

There are a couple of ways. See below:

# 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: matplotlib-users@lists.sourceforge.net
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?

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?

Regards,

Mikey

Hey,

Try:

I[1]: plt.plot(range(100), “o”, markersize=100)

I[2]: plt.plot(range(100), “o”, markersize=1)

I[3]: plt.figure(); plt.plot(range(100), “o”, ms=1)

···

On Fri, Feb 26, 2010 at 6:29 PM, mikey <abc.mikey@…3004…2…> wrote:


Download Intel® Parallel Studio Eval

Try the new software tools for yourself. Speed compiling, find bugs

proactively, and fine-tune applications for parallel performance.

See why Intel Parallel Studio got high marks during beta.

http://p.sf.net/sfu/intel-sw-dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Gökhan