Skip to content

Commit 6f18c49

Browse files
committed
update whats new for hatchcolor in collections
1 parent 5377127 commit 6f18c49

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

doc/users/next_whats_new/separated_hatchcolor.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,25 @@ Previously, hatch colors were the same as edge colors, with a fallback to
6161
For collections, a sequence of colors can be passed to the *hatchcolor* parameter
6262
which will be cycled through for each hatch, similar to *facecolor* and *edgecolor*.
6363

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+
6470
.. plot::
6571
: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.
6773

6874
import matplotlib.pyplot as plt
6975
import numpy as np
7076

77+
np.random.seed(19680801)
78+
7179
fig, ax = plt.subplots()
7280

73-
x = np.linspace(0, 1, 10)
74-
y = x**2
81+
x = np.random.rand(20)
82+
y = np.random.rand(20)
7583
colors = ["blue", "orange", "green"]
7684

7785
ax.scatter(
@@ -83,4 +91,5 @@ which will be cycled through for each hatch, similar to *facecolor* and *edgecol
8391
facecolor="none",
8492
edgecolor="black",
8593
)
94+
8695
plt.show()

0 commit comments

Comments
 (0)