Skip to content

Commit

Permalink
Merge branch 'feature_342_tcdiag_tcmpr_plotter' of https://github.com…
Browse files Browse the repository at this point in the history
…/dtcenter/METplotpy into feature_342_tcdiag_tcmpr_plotter
  • Loading branch information
bikegeek committed Apr 1, 2024
2 parents 4e75e4b + a489578 commit 321581c
Showing 1 changed file with 33 additions and 23 deletions.
56 changes: 33 additions & 23 deletions metplotpy/plots/tcmpr_plots/box/tcmpr_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,39 @@ def _draw_series(self, series: TcmprSeries) -> None:
# create a trace

# boxplot, when connect_points is False in config file

if not self.config_obj.connect_points:
if 'point' in self.config_obj.plot_type_list:
if self.config_obj.connect_points:
# line plot
mode = 'lines+markers'
else:
# points only
mode = 'markers'
# Create a point plot
self.figure.add_trace(
go.Scatter(x=series.series_data['LEAD_HR'],
y=series.series_points['mean'],
showlegend=True,
mode=mode,
name=self.config_obj.user_legends[series.idx],
marker=dict(
color=marker_line_color,
size=8,
opacity=0.7,
line=dict(
color=self.config_obj.colors_list[series.idx],
width=1
)
),
),
secondary_y=series.y_axis != 1
)

# When a line plot is requested, connect any gaps
if self.config_obj.connect_points:
self.figure.update_traces(connectgaps=True)

else:
# Boxplot
self.figure.add_trace(
go.Box(x=series.series_data['LEAD_HR'],
y=series.series_data['PLOT'],
Expand All @@ -92,25 +123,4 @@ def _draw_series(self, series: TcmprSeries) -> None:
),
secondary_y=series.y_axis != 1
)
else:
# Create a point plot
self.figure.add_trace(
go.Scatter(x=series.series_data['LEAD_HR'],
y=series.series_points['mean'],
showlegend=True,
mode='lines+markers',
name=self.config_obj.user_legends[series.idx],
marker=dict(
color=marker_line_color,
size=8,
line=dict(
color=self.config_obj.colors_list[series.idx],
width=1
)
),
),
secondary_y=series.y_axis != 1
)

# Connect any gaps, so we always have line plot(s)
self.figure.update_traces(connectgaps=True)

0 comments on commit 321581c

Please sign in to comment.