For example, say I want to plot with color='None'
but markeredgecolor='mediumseagreen'
with the edges having alpha=0.5
. Is that possible?
MatPlotLib with Python Create x_data and y_data(sin(x_data)), using numpy. Plot curve using x_data and y_data, with marker style and marker size. By changing the alpha, we can make it transparent to opaque.
You can update the alpha value of an existing Line2D , using the set_alpha method. The idea would be to plot the line once and then update the alpha in the loop.
Matplotlib allows you to adjust the transparency of a graph plot using the alpha attribute. If you want to make the graph plot more transparent, then you can make alpha less than 1, such as 0.5 or 0.25. If you want to make the graph plot less transparent, then you can make alpha greater than 1.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With