🌐 AI搜索 & 代理 主页
Skip to content

Commit 890c8b7

Browse files
committed
DOC: Updated example using new feature
1 parent fb16dcb commit 890c8b7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

examples/ticks_and_spines/tick_transform_formatter.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,13 @@ def __call__(self, x):
9393

9494
fig = plt.figure()
9595
ax1 = fig.add_subplot(111)
96-
ax2 = fig.add_subplot(111, sharex=ax1, sharey=ax1, frameon=False)
96+
ax2 = fig.add_subplot(111, sharex=ax1, sharey=ax1,
97+
frameon=False, share_tickers=False)
9798

9899
ax1.plot(temp_C, counts, drawstyle='steps-mid')
99100

100101
ax1.xaxis.set_major_formatter(StrMethodFormatter('{x:0.2f}'))
101102

102-
# This step is necessary to allow the shared x-axes to have different
103-
# Formatter and Locator objects.
104-
ax2.xaxis.major = Ticker()
105103
# 0C -> 491.67R (definition), -273.15C (0K)->0R (-491.67F)(definition)
106104
ax2.xaxis.set_major_locator(ax1.xaxis.get_major_locator())
107105
ax2.xaxis.set_major_formatter(

0 commit comments

Comments
 (0)