Variable size plot symbols, variable hue plot colors in Python (MatPlotLib) ?

D

Dr. Colombes

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 other plot
symbols such a small circle, Medium square, LARGE cross, etc.?

Similarly, using the MatPlotLib plot function, is there a way to get
variable hue (RGB-specified) plot colors? For example, using symbol
strings like 'b' (blue), 'g' (green), 'red' (red), etc., is there a way
to specify other colors such as light blue, dark green, pink, etc.?

Or perhaps is there some other Python MatPlotLib or other Python module
functions that allow variable size plot symbols and variable hue plot
colors in Python ?

Thank you for your suggestions.
 
J

John Hunter

Colombes> Using MatPlotLib plot function, is there a way to get
Colombes> variable size plot symbols? For example, using symbol
Colombes> strings like 'o' (circle), 's' (square), 'x' (cross),
Colombes> etc., is there a way to specify other plot symbols such
Colombes> a small circle, Medium square, LARGE cross, etc.?

plot(x, y, 'o', markersize=10) # big
plot(x, y, 'o', markersize=20) # bigger

Colombes> Similarly, using the MatPlotLib plot function, is there
Colombes> a way to get variable hue (RGB-specified) plot colors?
Colombes> For example, using symbol strings like 'b' (blue), 'g'
Colombes> (green), 'red' (red), etc., is there a way to specify
Colombes> other colors such as light blue, dark green, pink, etc.?

All legal html color names are supported

Eg

lightblue : #ADD8E6
lightcoral : #F08080
lightcyan : #E0FFFF
lightgoldenrodyellow : #FAFAD2
lightgreen : #90EE90
lightgrey : #D3D3D3
lightpink : #FFB6C1
lightsalmon : #FFA07A
lightseagreen : #20B2AA
lightskyblue : #87CEFA
lightslategray : #778899
lightsteelblue : #B0C4DE
lightyellow : #FFFFE0


# or use aliases for less typing
# or rgba or hex

Colombes> Or perhaps is there some other Python MatPlotLib or
Colombes> other Python module functions that allow variable size
Colombes> plot symbols and variable hue plot colors in Python ?

The scatter command supports markers with varying sizes and colors.
screenshot with example code at
http://matplotlib.sourceforge.net/screenshots.html#scatter_demo2 .
Docs at
http://matplotlib.sourceforge.net/matplotlib.pylab.html#-scatter.

You might want to check out the tutorial and/or the user's guide.
Most of these issues are touched on there.

JDH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top