22

For example, say I want to plot with color='None' but markeredgecolor='mediumseagreen' with the edges having alpha=0.5. Is that possible?

8
  • 3
    You just have to pass the color in as an RGBA tuple
    – tacaswell
    Sep 11, 2014 at 17:22
  • 1
    I'm not sure I agree this is a duplicate. There are kwargs like markeredgecolor and markeredgewidth...so I was curious if there was an equivalent to markeredgealpha. That would be very convenient in situations where the markeredgecolor is being set as something other than RGB. I.e. in my example, I'd like 50% opacity mediumseagreen. But I don't know the RGB value of mediumseagreen off the top of my head...
    – 8one6
    Sep 11, 2014 at 18:47
  • Can't argue with that. Maybe I'll do a small pull request to make the markeredgealpha kwarg that I'm pining for.
    – 8one6
    Sep 12, 2014 at 0:22
  • 2
    just to clarify a couple typos: matplotlib.colors.ColorConverter().to_rgba('mediumseagreen', alpha=0.5)
    – 8one6
    Sep 12, 2014 at 17:57
  • The colors module has a singleton instance of ColorConverter called colorconvertor so I would not say it is a typo.
    – tacaswell
    Sep 12, 2014 at 18:53

1 Answer 1

21

As answered in the comments:

Either pass the color as an RGBA tuple or get the RGBA value from colorConverter:

matplotlib.colors.colorConverter.to_rgba('mediumseagreen', alpha=.5)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.