Skip to content

Commit 342e70a

Browse files
HakonSohoelgithub-actions[bot]
authored andcommitted
Reverse zorder in ensemble plot
In commit c580f1d reversed chronologically sorting of ensembles was added in the EnsembleSelectionWidget. This affected the drawing order of iterations, making the newer iterations hide the older iterations when using the default sorting order. This commit remedies this by reversing the zorder of plots, so that the first ensembles in the selection list will be drawn on top of the later ensembles. (cherry picked from commit 5305871)
1 parent 4fdde72 commit 342e70a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/ert/gui/tools/plot/plottery/plots/ensemble.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def plot(
3838
plot_context.y_axis = plot_context.VALUE_AXIS
3939
plot_context.x_axis = plot_context.DATE_AXIS
4040
draw_style = "steps-pre" if is_rate(plot_context.key()) else None
41-
41+
zorder = 0
4242
for ensemble, data in ensemble_to_data_map.items():
4343
data = data.T
4444

@@ -53,7 +53,9 @@ def plot(
5353
data,
5454
f"{ensemble.experiment_name} : {ensemble.name}",
5555
draw_style,
56+
zorder=zorder,
5657
)
58+
zorder -= 1
5759
config.nextColor()
5860

5961
plotObservations(observation_data, plot_context, axes)
@@ -75,6 +77,7 @@ def _plotLines(
7577
data: pd.DataFrame,
7678
ensemble_label: str,
7779
draw_style: str | None = None,
80+
zorder: float = 1,
7881
) -> None:
7982
style = plot_config.defaultStyle()
8083

@@ -91,6 +94,7 @@ def _plotLines(
9194
linestyle=style.line_style,
9295
markersize=style.size,
9396
drawstyle=draw_style,
97+
zorder=zorder,
9498
)
9599

96100
if len(lines) > 0:

0 commit comments

Comments
 (0)