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

Geometry: Add left and right line into XY plot.

Showing with 39 additions and 0 deletions
+39 -0
...@@ -61,6 +61,7 @@ class PlotXY(PamhyrPlot): ...@@ -61,6 +61,7 @@ class PlotXY(PamhyrPlot):
return return
self.draw_xy() self.draw_xy()
self.draw_lr()
self.draw_gl() self.draw_gl()
self.draw_current() self.draw_current()
...@@ -90,6 +91,37 @@ class PlotXY(PamhyrPlot): ...@@ -90,6 +91,37 @@ class PlotXY(PamhyrPlot):
) )
self.line_xy.append(line) 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): def draw_gl(self):
x_complete = self.data.get_guidelines_x() x_complete = self.data.get_guidelines_x()
y_complete = self.data.get_guidelines_y() y_complete = self.data.get_guidelines_y()
...@@ -139,6 +171,7 @@ class PlotXY(PamhyrPlot): ...@@ -139,6 +171,7 @@ class PlotXY(PamhyrPlot):
if self.data is None: if self.data is None:
return return
self.update_lr()
self.update_gl() self.update_gl()
self.update_current() self.update_current()
...@@ -207,3 +240,9 @@ class PlotXY(PamhyrPlot): ...@@ -207,3 +240,9 @@ class PlotXY(PamhyrPlot):
self.data.profile(after).y() self.data.profile(after).y()
) )
self.after_plot_selected.set_visible(True) self.after_plot_selected.set_visible(True)
def update_lr(self):
for line in self.line_lr:
line[0].remove()
self.draw_lr()
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