Skip to content

Commit 6991443

Browse files
authored
Merge pull request #14 from viliml/patch-1
Fix plot ticks.
2 parents c9519d9 + 1a33cc1 commit 6991443

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

getnative/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ def save_plot(self, vals):
239239
plot.style.use('dark_background')
240240
fig, ax = plot.subplots(figsize=(12, 8))
241241
ax.plot(range(self.min_h, self.max_h + 1, self.steps), vals, '.w-')
242-
dh_sequence = tuple(range(500, 1001, self.steps))
243-
ticks = tuple(dh for i, dh in enumerate(dh_sequence) if i % (50 // self.steps) == 0)
242+
dh_sequence = tuple(range(self.min_h, self.max_h + 1, self.steps))
243+
ticks = tuple(dh for i, dh in enumerate(dh_sequence) if i % ((self.max_h - self.min_h + 10 * self.steps - 1) // (10 * self.steps)) == 0)
244244
ax.set(xlabel="Height", xticks=ticks, ylabel="Relative error", title=self.filename, yscale="log")
245245
if self.show_plot:
246246
plot.show()

0 commit comments

Comments
 (0)