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

John Hunter jdhunter at
Tue Oct 19 16:11:06 CEST 2004

>>>>> "Colombes" == Colombes  <DrColombes at> 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.


 example code:


 scatter help:

scatter support the following marker shapes (currently all regular

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

Hope this helps,

More information about the Python-list mailing list