Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix #482 support any variation of 1, true in show_legend settings… #487

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion metplotpy/plots/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,21 @@ def _get_show_legend(self) -> list:
be used for the traces
"""
show_legend_settings = self.get_config_value('show_legend')

# Support all variations of setting the show_legend: '1', 1, "true" (any combination of cases), True (boolean)
updated_show_legend_settings = []
for legend_setting in show_legend_settings:
legend_setting = str(legend_setting).lower()
if legend_setting == '1' or legend_setting == 'true' or legend_setting == 1 or legend_setting is True:
updated_show_legend_settings.append(int(1))
else:
updated_show_legend_settings.append(int(0))


if show_legend_settings is None:
raise ValueError("ERROR: show_legend parameter is not provided.")

return self.create_list_by_series_ordering(list(show_legend_settings))
return self.create_list_by_series_ordering(list(updated_show_legend_settings))

def _get_markers(self):
"""
Expand Down
Loading