WizardShaft: Automatic adjustment of axes length
This commit is contained in:
@@ -73,7 +73,7 @@ class Diagram:
|
||||
if xlength is not None:
|
||||
self.xlength = xlength
|
||||
# Calculate points
|
||||
(self.xpoints, self.ypoints) = self.function.evaluate(self.xlength, self.numxpoints)
|
||||
(self.xpoints, self.ypoints) = self.function.evaluate(self.xlength, self.numxpoints)
|
||||
# Create plot
|
||||
self.plot()
|
||||
|
||||
@@ -91,3 +91,8 @@ class Diagram:
|
||||
self.xpoints = [p * self.xscale for p in self.xpoints]
|
||||
self.ypoints = [p * self.yscale for p in self.ypoints]
|
||||
self.thePlot.plot(self.xpoints, self.ypoints)
|
||||
plots = self.thePlot.series
|
||||
axes = plots[0].axes
|
||||
axes.set_xlim(right = max(self.xpoints) * 1.05)
|
||||
axes.set_ylim(min(self.ypoints) * 1.05, max(self.ypoints) * 1.05)
|
||||
self.thePlot.update()
|
||||
|
||||
Reference in New Issue
Block a user