You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/users/next_whats_new/separated_hatchcolor.rst
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -61,17 +61,25 @@ Previously, hatch colors were the same as edge colors, with a fallback to
61
61
For collections, a sequence of colors can be passed to the *hatchcolor* parameter
62
62
which will be cycled through for each hatch, similar to *facecolor* and *edgecolor*.
63
63
64
+
Previously, if *edgecolor* was not specified, the hatch color would fall back to
65
+
:rc:`patch.edgecolor`, but the alpha value would default to **1.0**, regardless of the
66
+
alpha value of the collection. This behavior has been changed such that, if both
67
+
*hatchcolor* and *edgecolor* are not specified, the hatch color will fall back
68
+
to 'patch.edgecolor' with the alpha value of the collection.
69
+
64
70
.. plot::
65
71
:include-source: true
66
-
:alt: A scatter plot of a quadratic function with hatches on the markers. The hatches are colored in blue, orange, and green, respectively. After the first three markers, the colors are cycled through again.
72
+
:alt: A random scatter plot with hatches on the markers. The hatches are colored in blue, orange, and green, respectively. After the first three markers, the colors are cycled through again.
67
73
68
74
import matplotlib.pyplot as plt
69
75
import numpy as np
70
76
77
+
np.random.seed(19680801)
78
+
71
79
fig, ax = plt.subplots()
72
80
73
-
x = np.linspace(0, 1, 10)
74
-
y = x**2
81
+
x = np.random.rand(20)
82
+
y = np.random.rand(20)
75
83
colors = ["blue", "orange", "green"]
76
84
77
85
ax.scatter(
@@ -83,4 +91,5 @@ which will be cycled through for each hatch, similar to *facecolor* and *edgecol
0 commit comments