Skip to content

Commit 1a33cc1

Browse files
authored
Fix plot ticks even better.
Best guess to extrapolate the existing ticks for 500-1000 to arbitrary ranges.
1 parent 85670a0 commit 1a33cc1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

getnative/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def save_plot(self, vals):
240240
fig, ax = plot.subplots(figsize=(12, 8))
241241
ax.plot(range(self.min_h, self.max_h + 1, self.steps), vals, '.w-')
242242
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 % (50 // self.steps) == 0)
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)