-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone
Description
Using matplotlib master and a color defined by a string indicating a gray shade, the alpha parameter gets ignored in calls to, e.g. plt.plot. Example:
intercepts=np.random.randn(100)
ms=np.random.randn(100)
x=np.linspace(-5,5,100)
for m,i in zip(ms,intercepts):
plt.plot(m*x+i, c='0.1', alpha=0.2)
whereas the expected result can be obtained by converting the string to a tuple:
for m,i in zip(ms,intercepts):
plt.plot(m*x+i, c=(0.1, 0.1, 0.1, 1.0), alpha=0.2)
Looking at the code, it seems that all colors are passed through colors.to_rgba, and in my setup it correctly converts the string to the tuple, so it seems the problem is elsewhere.
>>> mpl.colors.to_rgba('0.1')
(0.1, 0.1, 0.1, 1.0)
This used to work in previous v2.x branch commits (cannot really pinpoint where it failed first time) and in v1.5.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

