By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,434 Members | 2,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,434 IT Pros & Developers. It's quick & easy.

MatPlotLib question: How to get more different size plot symbols ?

P: n/a
MatPlotLib question: How to get more different size plot symbols in
the plot function ?

Is there a way to get different size squares (or circles or triangles,
etc.) ?

For example, in a two dimensional plot of heights and weights of
individuals, is there a way to represent also the age of the
individual by the size of the plot symbol ?

Thanks for your help.
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
>>>>> "Colombes" == Colombes <Dr********@yahoo.com> writes:

Colombes> MatPlotLib question: How to get more different size plot
Colombes> symbols in the plot function ?

Colombes> Is there a way to get different size squares (or circles
Colombes> or triangles, etc.) ?

Colombes> For example, in a two dimensional plot of heights and
Colombes> weights of individuals, is there a way to represent also
Colombes> the age of the individual by the size of the plot symbol
Colombes> ?

Yes, you will want to use the scatter function for this. With "plot",
you can change the size of the symbols with the markersize keyword
argument, but all of the markers must be the same size. With scatter,
the individual marker size (and colors) can vary.

See

example code: http://matplotlib.sf.net/examples/scatter_demo.py

screenshot: http://matplotlib.sourceforge.net/sc...#scatter_demo2

scatter help: http://matplotlib.sourceforge.net/ma....html#-scatter

scatter support the following marker shapes (currently all regular
polygons)

's' : square
'o' : circle
'^' : triangle up
'>' : triangle right
'v' : triangle down
'<' : triangle left
'd' : diamond
'p' : pentagram
'h' : hexagon
'8' : octagon

Hope this helps,
JDH
Jul 18 '05 #2

P: n/a
Thanks, John.

Nothing like getting the info straight from the source.

John Hunter <jd******@ace.bsd.uchicago.edu> wrote in message news:<ma**************************************@pyt hon.org>...
>> "Colombes" == Colombes <Dr********@yahoo.com> writes:


Colombes> MatPlotLib question: How to get more different size plot
Colombes> symbols in the plot function ?

Colombes> Is there a way to get different size squares (or circles
Colombes> or triangles, etc.) ?

Colombes> For example, in a two dimensional plot of heights and
Colombes> weights of individuals, is there a way to represent also
Colombes> the age of the individual by the size of the plot symbol
Colombes> ?

Yes, you will want to use the scatter function for this. With "plot",
you can change the size of the symbols with the markersize keyword
argument, but all of the markers must be the same size. With scatter,
the individual marker size (and colors) can vary.

See

example code: http://matplotlib.sf.net/examples/scatter_demo.py

screenshot: http://matplotlib.sourceforge.net/sc...#scatter_demo2

scatter help: http://matplotlib.sourceforge.net/ma....html#-scatter

scatter support the following marker shapes (currently all regular
polygons)

's' : square
'o' : circle
'^' : triangle up
'>' : triangle right
'v' : triangle down
'<' : triangle left
'd' : diamond
'p' : pentagram
'h' : hexagon
'8' : octagon

Hope this helps,
JDH

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.