diff --git a/metplotpy/plots/wind_rose/wind_rose.py b/metplotpy/plots/wind_rose/wind_rose.py index 9ee6bec5f..35317feb7 100644 --- a/metplotpy/plots/wind_rose/wind_rose.py +++ b/metplotpy/plots/wind_rose/wind_rose.py @@ -145,25 +145,27 @@ def _create_figure(self): automargin=True ) - fig.update_polars( - bgcolor=PLOTLY_PAPER_BGCOOR, - hole=0.08, - angularaxis_thetaunit="degrees", - angularaxis_rotation=90, - angularaxis_direction='clockwise', - angularaxis_gridcolor=PLOTLY_AXIS_LINE_COLOR, - angularaxis_tickvals=self.config_obj.angularaxis_tickvals, - angularaxis_ticktext=self.config_obj.angularaxis_ticktext, - angularaxis_tickmode='array', - radialaxis_angle=135, - radialaxis_tickmode='linear', - radialaxis_tickangle=100, - radialaxis_tick0=5, - radialaxis_dtick=5, - radialaxis_gridcolor=PLOTLY_AXIS_LINE_COLOR, - radialaxis_showticklabels=True, - radialaxis_ticksuffix='%' - ) + if self.config_obj.radialaxis_range is None: + fig.update_polars( + bgcolor=PLOTLY_PAPER_BGCOOR, hole=0.08, angularaxis_thetaunit="degrees", angularaxis_rotation=90, + angularaxis_direction='clockwise', angularaxis_gridcolor=PLOTLY_AXIS_LINE_COLOR, + angularaxis_tickvals=self.config_obj.angularaxis_tickvals, + angularaxis_ticktext=self.config_obj.angularaxis_ticktext, angularaxis_tickmode='array', + radialaxis_angle=135, radialaxis_tickmode='linear', radialaxis_tickangle=100, radialaxis_tick0=5, + radialaxis_dtick=self.config_obj.radialaxis_step, radialaxis_gridcolor=PLOTLY_AXIS_LINE_COLOR, + radialaxis_showticklabels=True, + radialaxis_ticksuffix='%', radialaxis_type="-", ) + else: + fig.update_polars( + bgcolor=PLOTLY_PAPER_BGCOOR, hole=0.08, angularaxis_thetaunit="degrees", angularaxis_rotation=90, + angularaxis_direction='clockwise', angularaxis_gridcolor=PLOTLY_AXIS_LINE_COLOR, + angularaxis_tickvals=self.config_obj.angularaxis_tickvals, + angularaxis_ticktext=self.config_obj.angularaxis_ticktext, angularaxis_tickmode='array', + radialaxis_angle=135, radialaxis_tickmode='linear', radialaxis_tickangle=100, + radialaxis_tick0=self.config_obj.radialaxis_range[0], + radialaxis_dtick=self.config_obj.radialaxis_step, radialaxis_gridcolor=PLOTLY_AXIS_LINE_COLOR, + radialaxis_showticklabels=True, + radialaxis_ticksuffix='%', radialaxis_type="-", radialaxis_range=self.config_obj.radialaxis_range, ) fig.update_layout( showlegend=self.config_obj.show_legend, diff --git a/metplotpy/plots/wind_rose/wind_rose_config.py b/metplotpy/plots/wind_rose/wind_rose_config.py index 5f5e2d006..ffca30afd 100644 --- a/metplotpy/plots/wind_rose/wind_rose_config.py +++ b/metplotpy/plots/wind_rose/wind_rose_config.py @@ -43,12 +43,22 @@ def __init__(self, parameters): self.show_legend = self.get_config_value('show_legend') self.angularaxis_tickvals = self.get_config_value('angularaxis_tickvals') self.angularaxis_ticktext = self.get_config_value('angularaxis_ticktext') + + # Range of radial axes (start, end). The radial axis type is the default ('-'), in + # which Plotly attempts to determine the axis type based on looking at the + # data. The wind_rose.py sets this to '-' in the event of any future changes. + self.radialaxis_range = self.get_config_value('radialaxis_range') + self.radialaxis_step = self.get_config_value('radialaxis_step') + self.stat_input = self.get_config_value('stat_input') self.plot_width = self.get_config_value('plot_width') self.plot_height = self.get_config_value('plot_height') self.dump_points = self.get_config_value('dump_points') + # Optional setting, indicates *where* to save the dump_points_1 file # used by METviewer self.points_path = self.get_config_value('points_path') self.show_in_browser = self.get_config_value('show_in_browser') + +