Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a59cb2

Browse files
committed
Add marker-only and line+marker visuals to the plot() plot types
Inspired from the discussion in #27765: We should visually communicate that `plot()` covers all three variants: markers only, line+markers, line-only. They are visually distinct enough that it's not possible to infer the variants if you see only one. In particular, it's important to communicate that you can draw markers only. We don't want to automatically drive people who want markers (e.g. some discrete measurements of a dependent variable y (x)) to scatter because that's the only one showing discrete markers in the overview.
1 parent d2cc4d0 commit 2a59cb2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

galleries/plot_types/basic/plot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313

1414
# make data
1515
x = np.linspace(0, 10, 100)
16-
y = 4 + 2 * np.sin(2 * x)
16+
y = 4 + 1 * np.sin(2 * x)
17+
x2 = np.linspace(0, 10, 25)
18+
y2 = 4 + 1 * np.sin(2 * x2)
1719

1820
# plot
1921
fig, ax = plt.subplots()
2022

23+
ax.plot(x2, y2 + 2.5, 'x', markeredgewidth=2)
2124
ax.plot(x, y, linewidth=2.0)
25+
ax.plot(x2, y2 - 2.5, 'o-', linewidth=2)
2226

2327
ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
2428
ylim=(0, 8), yticks=np.arange(1, 8))

0 commit comments

Comments
 (0)