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

Discussion in 'Python' started by Dr. Colombes, Feb 10, 2005.

  1. Dr. Colombes

    Dr. Colombes Guest

    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.
    Dr. Colombes, Feb 10, 2005
    #1
    1. Advertising

  2. Dr. Colombes

    John Hunter Guest

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

    >>>>> "Colombes" == Colombes <> 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/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
    John Hunter, Feb 10, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fjodor Klondyke
    Replies:
    9
    Views:
    16,968
    Toby A Inkster
    Jan 14, 2004
  2. John Hunter
    Replies:
    2
    Views:
    2,576
    Dr. Colombes
    Oct 20, 2004
  3. AAaron123

    TreeNode colors come from anchor colors

    AAaron123, Aug 7, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    536
    darrel
    Aug 7, 2008
  4. ZelluX
    Replies:
    3
    Views:
    1,882
    Peter Otten
    Dec 1, 2008
  5. Hee sejou
    Replies:
    4
    Views:
    112
    Gary Hasler
    Aug 13, 2004
Loading...

Share This Page