Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions examples/ticks_and_spines/tick_label_right.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@
These properties can also be set in the ``.matplotlib/matplotlibrc``.

"""


import matplotlib.pyplot as plt
import numpy as np

plt.rcParams['ytick.right'] = plt.rcParams['ytick.labelright'] = True
plt.rcParams['ytick.left'] = plt.rcParams['ytick.labelleft'] = False


x = np.arange(10)

_, ax = plt.subplots(2, 1, sharex=True, figsize=(6, 6))
fig, (ax0, ax1) = plt.subplots(2, 1, sharex=True, figsize=(6, 6))

ax[0].plot(x)
ax[0].yaxis.tick_left()
ax0.plot(x)
ax0.yaxis.tick_left()

# use default parameter in rcParams, not calling tick_right()
ax[1].plot(x)
ax1.plot(x)

plt.show()
9 changes: 5 additions & 4 deletions examples/ticks_and_spines/tick_xlabel_top.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
These properties can also be set in the ``.matplotlib/matplotlibrc``.

"""


import matplotlib.pyplot as plt
import numpy as np

Expand All @@ -21,6 +19,9 @@

x = np.arange(10)

plt.plot(x)
plt.title('xlabel top')
fig, ax = plt.subplots()

ax.plot(x)
ax.set_title('xlabel top', pad=24) # increase padding to make room for labels

plt.show()