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

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

P: n/a
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.

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


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

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
plot(x, y, 'o', markersize=10, markerfacecolor='green', markeredgecolor='red')
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 plot(x, y, 'o', ms=10, mfc='green', mec='red')
# or rgba or hex plot(x, y, 'o', ms=10, mfc='#008000, mec=(1,0,0,1) )

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/sc...#scatter_demo2 .
Docs at
http://matplotlib.sourceforge.net/ma....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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.