Skip to content

Commit aafdd93

Browse files
jstacclaude
andcommitted
Drop the pinned final-year x-axis tick
The added final-year tick crowded the existing 2020 ("Covid-19") tick and looked worse than the gap it was meant to address. Revert to matplotlib's default x-axis ticks in plot_series and plot_comparison. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a7c4913 commit aafdd93

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

lectures/business_cycle.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,6 @@ def plot_series(data, country, ylabel,
184184
ax.axhline(y=baseline,
185185
color='black',
186186
linestyle='--')
187-
188-
# Pin the most recent year as an x-axis tick
189-
final_year = data.columns.max()
190-
ax.set_xlim(right=final_year)
191-
xticks = [t for t in ax.get_xticks() if t <= final_year - 3]
192-
ax.set_xticks(xticks + [final_year])
193-
194187
ax.set_ylabel(ylabel)
195188
ax.legend()
196189
return ax
@@ -493,13 +486,6 @@ def plot_comparison(data, countries,
493486
'GFC\n(2008)', **t_params)
494487
ax.text(2020, ylim + ylim*txt_pos,
495488
'Covid-19\n(2020)', **t_params)
496-
497-
# Pin the most recent year as an x-axis tick
498-
final_year = data.columns.max()
499-
ax.set_xlim(right=final_year)
500-
xticks = [t for t in ax.get_xticks() if t <= final_year - 3]
501-
ax.set_xticks(xticks + [final_year])
502-
503489
if baseline != None:
504490
ax.hlines(y=baseline, xmin=ax.get_xlim()[0],
505491
xmax=ax.get_xlim()[1], color='black',

0 commit comments

Comments
 (0)