Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31d83a8

Browse files
authored
Merge pull request#25505 from rcomer/markers-examples
DOC: combine marker examples
2 parents0b4e615 +8696168 commit31d83a8

File tree

2 files changed

+16
-64
lines changed

2 files changed

+16
-64
lines changed

‎galleries/examples/lines_bars_and_markers/scatter_custom_symbol.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎galleries/examples/lines_bars_and_markers/scatter_star_poly.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
66
Example with different ways to specify markers.
77
8-
For a list of all markers see also the `matplotlib.markers` documentation.
8+
See also the `matplotlib.markers` documentation for a list of all markers and
9+
:doc:`/gallery/lines_bars_and_markers/marker_reference` for more information
10+
on configuring markers.
11+
12+
.. redirect-from:: /gallery/lines_bars_and_markers/scatter_custom_symbol
13+
.. redirect-from:: /gallery/lines_bars_and_markers/scatter_symbol
14+
.. redirect-from:: /gallery/lines_bars_and_markers/scatter_piecharts
915
"""
1016
importmatplotlib.pyplotasplt
1117
importnumpyasnp
@@ -17,32 +23,31 @@
1723
y=np.random.rand(10)
1824
z=np.sqrt(x**2+y**2)
1925

20-
fig,axs=plt.subplots(2,3,sharex=True,sharey=True)
26+
fig,axs=plt.subplots(2,3,sharex=True,sharey=True,layout="constrained")
2127

22-
# marker symbol
28+
#Matplotlibmarker symbol
2329
axs[0,0].scatter(x,y,s=80,c=z,marker=">")
2430
axs[0,0].set_title("marker='>'")
2531

26-
# marker from TeX
27-
axs[0,1].scatter(x,y,s=80,c=z,marker=r'$\alpha$')
28-
axs[0,1].set_title(r"marker=r'\$\alpha\$'")
32+
# marker from TeX: passing a TeX symbol name enclosed in $-signs
33+
axs[0,1].scatter(x,y,s=80,c=z,marker=r"$\clubsuit$")
34+
axs[0,1].set_title(r"marker=r'\$\clubsuit\$'")
2935

30-
# marker from path
36+
# marker from path: passing a custom path of N vertices as a (N, 2) array-like
3137
verts= [[-1,-1], [1,-1], [1,1], [-1,-1]]
3238
axs[0,2].scatter(x,y,s=80,c=z,marker=verts)
3339
axs[0,2].set_title("marker=verts")
3440

35-
# regularpolygon marker
41+
# regularpentagon marker
3642
axs[1,0].scatter(x,y,s=80,c=z,marker=(5,0))
3743
axs[1,0].set_title("marker=(5, 0)")
3844

39-
# regular star marker
45+
# regular5-pointedstar marker
4046
axs[1,1].scatter(x,y,s=80,c=z,marker=(5,1))
4147
axs[1,1].set_title("marker=(5, 1)")
4248

43-
# regular asterisk marker
49+
# regular5-pointedasterisk marker
4450
axs[1,2].scatter(x,y,s=80,c=z,marker=(5,2))
4551
axs[1,2].set_title("marker=(5, 2)")
4652

47-
plt.tight_layout()
4853
plt.show()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp