mirror of https://gitlab.com/pamhyr/pamhyr2
geometry: Plot update minor fix and autoscale.
parent
079a6b302e
commit
6c14e5ebf1
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue