473,387 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
2 4946
>>>>> "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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Hunter | last post by:
matplotlib is a 2D plotting library for python. You can use matplotlib interactively from a python shell or IDE, or embed it in GUI applications (WX, GTK, and Tkinter). matplotlib supports many...
1
by: Jorl Shefner | last post by:
I've only been able to plot data with both symbols and lines by issuing two plot commands, one for markers and one for lines. That's perfectly fine, but it creates a problem when I try to create a...
1
by: Dr. Colombes | last post by:
Using MatPlotLib plot function, is there a way to get variable size plot symbols? For example, using symbol strings like 'o' (circle), 's' (square), 'x' (cross), etc., is there a way to specify...
1
by: Jorl Shefner | last post by:
I have a problem that I run into a lot with the 'legend' command's default behavior. I've found a work-around but I wonder if there's a better way. For a simple example, take the following:...
2
by: bwaha | last post by:
Has anyone figured out how to get a legend for each line in a matplotlib.collections.LineCollection instance? No problem if I plot lines the default way ie. line,=plot(x,y). But I've had to...
12
by: orangeDinosaur | last post by:
Hi, I am exploring the possibility of using python as a replacement of MATLAB when I leave school. So, I've been playing with matplotlib and have run into some weird behavior after recently...
0
by: Soren | last post by:
Hi, I'm trying to create a small GUI program where I can do plots using Matplotlib. I've been trying to borrow code from the examples at the matplotlib website, but I can't get it to work. I...
0
by: Soren | last post by:
Hi, I've been trying to embed matplotlib in wxpython. I want to be able to put a figure (axes) in a wx.Panel and place it somewhere in my GUI. The GUI should have other panels with buttons etc....
4
by: Bill Jackson | last post by:
Hi, I'm having some trouble plotting with the following matplotlibrc: text.usetex : True I tried clearing the cache files under ~/.matplotlib, but this did not help the problem. I'd post...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.