mirror of https://gitlab.com/pamhyr/pamhyr2
Geometry: Add left and right line into XY plot.
parent
731567369e
commit
db87b1e214
|
|
@ -61,6 +61,7 @@ class PlotXY(PamhyrPlot):
|
|||
return
|
||||
|
||||
self.draw_xy()
|
||||
self.draw_lr()
|
||||
self.draw_gl()
|
||||
self.draw_current()
|
||||
|
||||
|
|
@ -90,6 +91,37 @@ class PlotXY(PamhyrPlot):
|
|||
)
|
||||
self.line_xy.append(line)
|
||||
|
||||
def draw_lr(self):
|
||||
lx = []
|
||||
ly = []
|
||||
rx = []
|
||||
ry = []
|
||||
|
||||
self.line_lr = []
|
||||
for x, y in zip(self.data.get_x(),
|
||||
self.data.get_y()):
|
||||
lx.append(x[0])
|
||||
ly.append(y[0])
|
||||
|
||||
rx.append(x[-1])
|
||||
ry.append(y[-1])
|
||||
|
||||
line = self.canvas.axes.plot(
|
||||
lx, ly,
|
||||
color=self.color_plot_river_bottom,
|
||||
linestyle="dotted",
|
||||
lw=1.,
|
||||
)
|
||||
self.line_lr.append(line)
|
||||
|
||||
line = self.canvas.axes.plot(
|
||||
rx, ry,
|
||||
color=self.color_plot_river_bottom,
|
||||
linestyle="dotted",
|
||||
lw=1.,
|
||||
)
|
||||
self.line_lr.append(line)
|
||||
|
||||
def draw_gl(self):
|
||||
x_complete = self.data.get_guidelines_x()
|
||||
y_complete = self.data.get_guidelines_y()
|
||||
|
|
@ -139,6 +171,7 @@ class PlotXY(PamhyrPlot):
|
|||
if self.data is None:
|
||||
return
|
||||
|
||||
self.update_lr()
|
||||
self.update_gl()
|
||||
self.update_current()
|
||||
|
||||
|
|
@ -207,3 +240,9 @@ class PlotXY(PamhyrPlot):
|
|||
self.data.profile(after).y()
|
||||
)
|
||||
self.after_plot_selected.set_visible(True)
|
||||
|
||||
def update_lr(self):
|
||||
for line in self.line_lr:
|
||||
line[0].remove()
|
||||
|
||||
self.draw_lr()
|
||||
|
|
|
|||
Loading…
Reference in New Issue