From f635ce4b340d3cf6804f917f014b63965fd66bc0 Mon Sep 17 00:00:00 2001 From: Tatiana Burek Date: Tue, 17 Oct 2023 14:59:43 -0600 Subject: [PATCH] specify the color of the no resolution and no skill lines for the reliability diagram #465 (#393) --- metplotpy/plots/config/reliability_defaults.yaml | 2 ++ metplotpy/plots/reliability_diagram/reliability.py | 4 ++-- metplotpy/plots/reliability_diagram/reliability_config.py | 2 ++ test/reliability_diagram/custom_reliability_points1.yaml | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/metplotpy/plots/config/reliability_defaults.yaml b/metplotpy/plots/config/reliability_defaults.yaml index 1cfdcce0..a95909a0 100644 --- a/metplotpy/plots/config/reliability_defaults.yaml +++ b/metplotpy/plots/config/reliability_defaults.yaml @@ -158,3 +158,5 @@ ytlab_horiz: 0.5 ytlab_orient: 1 ytlab_perp: 0.5 ytlab_size: 1 +noskill_line_col: 'red' +reference_line_col: 'red' diff --git a/metplotpy/plots/reliability_diagram/reliability.py b/metplotpy/plots/reliability_diagram/reliability.py index 6451e2fa..d2b63bee 100644 --- a/metplotpy/plots/reliability_diagram/reliability.py +++ b/metplotpy/plots/reliability_diagram/reliability.py @@ -318,7 +318,7 @@ def _add_noskill_line(self, o_bar: Union[float, None]) -> None: self.figure.add_trace( go.Scatter(x=[0, 1], y=[util.abline(0, intercept, 0.5), util.abline(1, intercept, 0.5)], - line={'color': 'red', + line={'color': self.config_obj.noskill_line_col, 'dash': 'dash', 'width': 1}, showlegend=False, @@ -393,7 +393,7 @@ def _add_noresolution_line(self, o_bar: Union[float, None]) -> None: self.figure.add_trace( go.Scatter(x=[0, 1], y=[util.abline(0, o_bar, 0), util.abline(1, o_bar, 0)], - line={'color': 'red', + line={'color': self.config_obj.reference_line_col, 'dash': 'dash', 'width': 1}, showlegend=False, diff --git a/metplotpy/plots/reliability_diagram/reliability_config.py b/metplotpy/plots/reliability_diagram/reliability_config.py index 05f9b74d..bcf581e3 100644 --- a/metplotpy/plots/reliability_diagram/reliability_config.py +++ b/metplotpy/plots/reliability_diagram/reliability_config.py @@ -63,6 +63,8 @@ def __init__(self, parameters: dict) -> None: self.rely_event_hist = self._get_bool('rely_event_hist') self.inset_hist = self._get_bool('inset_hist') self.summary_curves = self.get_config_value('summary_curves') + self.noskill_line_col = self.get_config_value('noskill_line_col') + self.reference_line_col = self.get_config_value('reference_line_col') ############################################## # caption parameters diff --git a/test/reliability_diagram/custom_reliability_points1.yaml b/test/reliability_diagram/custom_reliability_points1.yaml index af791870..3af1e78e 100644 --- a/test/reliability_diagram/custom_reliability_points1.yaml +++ b/test/reliability_diagram/custom_reliability_points1.yaml @@ -182,4 +182,6 @@ ytlab_perp: 0.5 ytlab_size: 1 plot_filename: ./intermed_files/reliability.png stat_input: ./reliability.data +noskill_line_col: 'green' +reference_line_col: 'blue'