diff --git a/src/ansys/aedt/core/visualization/report/common.py b/src/ansys/aedt/core/visualization/report/common.py index a9270c5951a..2d4aa353ed6 100644 --- a/src/ansys/aedt/core/visualization/report/common.py +++ b/src/ansys/aedt/core/visualization/report/common.py @@ -1970,7 +1970,9 @@ def edit_grid( return self._change_property("Grid", "Grid", props) @pyaedt_function_handler() - def edit_x_axis(self, font="Arial", font_size=12, italic=False, bold=False, color=(0, 0, 0), label=None): + def edit_x_axis( + self, font="Arial", font_size=12, italic=False, bold=False, color=(0, 0, 0), label=None, display_units=True + ): """Edit the X-axis settings. Parameters @@ -1988,6 +1990,8 @@ def edit_x_axis(self, font="Arial", font_size=12, italic=False, bold=False, colo must be an integer in a range from 0 to 255. label : str, optional Label for the Y axis. The default is ``None``. + display_units : bool, optional + Whether to display units. The default is ``True``. Returns ------- @@ -2037,6 +2041,8 @@ def edit_x_axis(self, font="Arial", font_size=12, italic=False, bold=False, colo if label: props.append(["NAME:Name", "Value:=", label]) props.append(["NAME:Axis Color", "R:=", color[0], "G:=", color[1], "B:=", color[2]]) + props.append(["NAME:Display Units", "Value:=", display_units]) + return self._change_property("Axis", "AxisX", props) @pyaedt_function_handler() @@ -2157,7 +2163,17 @@ def hide_legend(self, solution_name=True, trace_name=True, variation_key=True, f return False @pyaedt_function_handler(axis_name="name") - def edit_y_axis(self, name="Y1", font="Arial", font_size=12, italic=False, bold=False, color=(0, 0, 0), label=None): + def edit_y_axis( + self, + name="Y1", + font="Arial", + font_size=12, + italic=False, + bold=False, + color=(0, 0, 0), + label=None, + display_units=True, + ): """Edit the Y-axis settings. Parameters @@ -2177,6 +2193,8 @@ def edit_y_axis(self, name="Y1", font="Arial", font_size=12, italic=False, bold= must be an integer in a range from 0 to 255. label : str, optional Label for the Y axis. The default is ``None``. + display_units : bool, optional + Whether to display units. The default is ``True``. Returns ------- @@ -2226,6 +2244,7 @@ def edit_y_axis(self, name="Y1", font="Arial", font_size=12, italic=False, bold= if label: props.append(["NAME:Name", "Value:=", label]) props.append(["NAME:Axis Color", "R:=", color[0], "G:=", color[1], "B:=", color[2]]) + props.append(["NAME:Display Units", "Value:=", display_units]) return self._change_property("Axis", "Axis" + name, props) @pyaedt_function_handler(axis_name="name") diff --git a/tests/system/general/test_12_1_PostProcessing.py b/tests/system/general/test_12_1_PostProcessing.py index d3aca395b7f..59374d48539 100644 --- a/tests/system/general/test_12_1_PostProcessing.py +++ b/tests/system/general/test_12_1_PostProcessing.py @@ -475,8 +475,12 @@ def test_09m_edit_properties(self): assert report.edit_grid(major_color=(0, 0, 125)) assert report.edit_grid(major_color=(0, 255, 0)) assert report.edit_grid(style_major="Dot") - assert report.edit_x_axis(font="Courier", font_size=14, italic=True, bold=False, color=(0, 128, 0)) - assert report.edit_y_axis(font="Courier", font_size=14, italic=True, bold=False, color=(0, 128, 0)) + assert report.edit_x_axis( + font="Bangers", font_size=14, italic=True, bold=False, color=(0, 128, 0), display_units=False + ) + assert report.edit_y_axis( + font="Bangers", font_size=14, italic=True, bold=False, color=(0, 128, 0), display_units=False + ) assert report.edit_x_axis( font="Courier", font_size=14, italic=True, bold=False, color=(0, 128, 0), label="Freq" )