On Wed, Nov 16, 2011 at 5:35 PM, Jonno <jonnojohn...@gmail.com> wrote:

> I want to:
> 1. Have matplotlib assign the linecolor for a plot
> 2. Read the linecolor with .get_color()
> 3. Create another plot with the linecolor set to a lighter version of
> the previous linecolor.
>
> Ie:
>
> a, = plot(x,y)
> a.get_color() = 'b'
> b, = plot(x,y, color = "#xxxxxx")
>
> Since I'm only using the standard matplotlib assigned colors which
> cycle through b,g,r,c,m,y,k I thought I would just create a mapping
> between each color and a lighter version.
>
> How do I get the hex or RGB string for the base matplotlib colors?
>

There may be an easier way, but in the past I've used a color converter
object
(which seems unnecessarily verbose):

>>> import matplotlib.colors as mcolors
>>> cc = mcolors.ColorConverter()
>>> cc.to_rgb('b')
(0, 0, 1)



>
> Also, if there's a different property I can use to lighten the line
> color without changing the color that would be cool too.
>

If you have a white background (and no overlapping markers/lines), you
could just set the "alpha" argument in the plot command.

Best,
-Tony
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to