Skip to content

Commit cd56626

Browse files
committed
Fix tick label offsets to prevent confusion
Refs pombase/website#2450
1 parent 35f435f commit cd56626

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

stats/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def make_plot(raw_stat_type, column_name=None):
131131
ax.xaxis.set_major_locator(MultipleLocator(2))
132132

133133
ax.set_xlabel('')
134-
ax.tick_params(axis='x', labelrotation = 45)
134+
ax.set_xticklabels(ax.get_xticklabels(), rotation=45, ha='right', rotation_mode='anchor')
135135

136136
if "cumulative" in raw_stat_type:
137137
handles, labels = ax.get_legend_handles_labels()
@@ -161,7 +161,7 @@ def make_year_range_plot(raw_stat_type):
161161

162162
sns.barplot(ax=ax, x=df.index, y=df[df.columns[0]], color="#8192ca")
163163

164-
ax.set_xticklabels(ax.get_xticklabels(), rotation=45)
164+
ax.set_xticklabels(ax.get_xticklabels(), rotation=45, ha='right', rotation_mode='anchor')
165165

166166
fontsize = 14
167167

@@ -210,7 +210,7 @@ def make_by_year_plot(raw_stat_type):
210210

211211
sns.barplot(ax=ax, x=df.index, y=df[df.columns[0]], color="#8192ca")
212212

213-
ax.set_xticklabels(ax.get_xticklabels(), rotation=45)
213+
ax.set_xticklabels(ax.get_xticklabels(), rotation=45, ha='right', rotation_mode='anchor')
214214

215215
fontsize = 14
216216

0 commit comments

Comments
 (0)