Skip to content

Commit

Permalink
[CC] better format title and label for contribution plot
Browse files Browse the repository at this point in the history
  • Loading branch information
helene-t committed Jun 7, 2022
1 parent 19594a4 commit f8ccad6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions SciDataTool/Methods/DataND/plot_2D_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,21 @@ def plot_2D_Data(
Ydatas.append(contrib_array[Isort[i], :])
legends.append(contrib_axis.values[Isort[i]])
new_color_list.append(color_list[i % (len(color_list))])
sel_str = ""
if "all" not in selection:
if "stator" in selection:
sel_str += " applied to stator"
elif "rotor" in selection:
sel_str += " applied to rotor"
if "radial" in selection:
sel_str += " in radial direction"
elif "circ." in selection:
sel_str += " in circumferential direction"
title = " ".join(selection).capitalize()
else:
title = axes_dict[contribution_name].capitalize()
ylabel = title + " linear contribution to $" + symbol + "$ [%]"
title += " linear contribution to " + name
ylabel = name + " contribution [%]"
title = "Contribution of magnetic Load Cases" + sel_str

# Deactivate legend if only one item
if type_plot == "point":
Expand Down

0 comments on commit f8ccad6

Please sign in to comment.