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

Skip to content

Commit 1d3b18c

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 1d3b18c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

galleries/plot_types/basic/plot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
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)
1717

1818
# plot
1919
fig, ax = plt.subplots()
2020

21+
ax.plot(x[::4], y[::4]+2.5, 'x', markeredgewidth=2)
2122
ax.plot(x, y, linewidth=2.0)
23+
ax.plot(x[::4], y[::4]-2.5, 'o-', linewidth=2)
2224

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

0 commit comments

Comments
 (0)