Commit 6c14e5eb authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

geometry: Plot update minor fix and autoscale.

Showing with 40 additions and 16 deletions
+40 -16
......@@ -327,5 +327,6 @@ class PlotAC(APlot):
self.update_annotate_full(0)
self.canvas.axes.relim()
self.canvas.axes.autoscale()
self.canvas.axes.autoscale_view()
self.canvas.figure.canvas.draw_idle()
......@@ -104,6 +104,8 @@ class PlotXY(APlot):
)
self.after_plot_selected.set_visible(False)
self.canvas.axes.autoscale_view(True, True, True)
self.canvas.axes.autoscale()
self.canvas.figure.tight_layout()
self.canvas.figure.canvas.draw_idle()
self.toolbar.update()
......@@ -119,6 +121,40 @@ class PlotXY(APlot):
if self.data is None:
return
self.data.compute_guidelines()
x_complete = self.data.get_guidelines_x()
y_complete = self.data.get_guidelines_y()
for i in range(self.data.number_profiles):
if i < len(self.line_xy):
self.line_xy[i][0].set_data(
self.data.profile(i).x(),
self.data.profile(i).y()
)
else:
self.line_xy.append(
self.canvas.axes.plot(
self.data.profile(i).x(),
self.data.profile(i).y(),
lw=1., color='r',
markersize=3, marker='+'
)
)
for i in range(len(x_complete)):
if i < len(self.line_gl):
self.line_gl[i][0].set_data(
x_complete[i],
y_complete[i]
)
else:
self.line_gl.append(
self.canvas.axes.plot(
x_complete[i],
y_complete[i]
)
)
if ind is not None and self.display_current:
before = ind - 1
after = ind + 1
......@@ -141,22 +177,9 @@ class PlotXY(APlot):
self.after_plot_selected.set_data(self.data.profile(after).x(),
self.data.profile(after).y())
self.after_plot_selected.set_visible(True)
else:
for ind in range(self.data.number_profiles):
self.line_xy[ind][0].set_data(
self.data.profile(ind).x(),
self.data.profile(ind).y()
)
self.data.compute_guidelines()
x_complete = self.data.get_guidelines_x()
y_complete = self.data.get_guidelines_y()
for ind in range(len(self.line_gl)):
self.line_gl[ind][0].set_data(
x_complete[ind],
y_complete[ind]
)
self.canvas.axes.relim()
self.canvas.axes.autoscale()
self.canvas.axes.autoscale_view()
self.canvas.figure.tight_layout()
self.canvas.figure.canvas.draw_idle()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment