8000 Minor improvements to units_sample example · matplotlib/matplotlib@2ab4b05 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ab4b05

Browse files
committed
Minor improvements to units_sample example
1 parent dc163ca commit 2ab4b05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/units/units_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
cms = cm * np.arange(0, 10, 2)
2121

22-
fig, axs = plt.subplots(2, 2)
22+
fig, axs = plt.subplots(2, 2, constrained_layout=True)
2323

2424
axs[0, 0].plot(cms, cms)
2525

2626
axs[0, 1].plot(cms, cms, xunits=cm, yunits=inch)
2727

2828
axs[1, 0].plot(cms, cms, xunits=inch, yunits=cm)
29-
axs[1, 0].set_xlim(3, 6) # scalars are interpreted in current units
29+
axs[1, 0].set_xlim(-1, 4) # scalars are interpreted in current units
3030

3131
axs[1, 1].plot(cms, cms, xunits=inch, yunits=inch)
3232
axs[1, 1].set_xlim(3*cm, 6*cm) # cm are converted to inches

0 commit comments

Comments
 (0)
0