Skip to content

Commit 8036bd3

Browse files
committed
Added non-dimensional axis label option to plot export dialog
1 parent fcc1baa commit 8036bd3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pymead/gui/airfoil_canvas.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def airfoil_exited(self, airfoil: Airfoil):
953953
def removeCurve(self, curve):
954954
self.geo_col.remove_pymead_obj(curve)
955955

956-
def exportPlot(self):
956+
def exportPlot(self, theme: dict):
957957
color_bar_data = self.color_bar_data
958958
current_min_level, current_max_level = None, None
959959
if color_bar_data is not None:
@@ -968,6 +968,9 @@ def exportPlot(self):
968968
# Get the inputs from the dialog
969969
inputs = dialog.value()
970970

971+
self.plot.setLabel(axis="bottom", text=f"x/c")
972+
self.plot.setLabel(axis="left", text=f"y/c")
973+
971974
# Create the pyqtgraph ImageExporter object from the airfoil canvas
972975
exporter = pg.exporters.ImageExporter(self.plot)
973976

@@ -993,6 +996,9 @@ def exportPlot(self):
993996
# Export the image
994997
exporter.export(file_path)
995998

999+
# Return the axis labels to their original state
1000+
self.setAxisLabels(theme=theme)
1001+
9961002
# Display success message
9971003
self.gui_obj.disp_message_box(f"Plot saved to {file_path}", message_mode="info")
9981004

@@ -1082,7 +1088,7 @@ def contextMenuEvent(self, event, **kwargs):
10821088
elif res == splitPolyAction and curve is not None:
10831089
self.splitPoly(curve)
10841090
elif res == exportPlotAction:
1085-
self.exportPlot()
1091+
self.exportPlot(theme=self.gui_obj.themes[self.gui_obj.current_theme])
10861092
elif res == makeAirfoilAbsoluteAction:
10871093
self.makeAbsolute()
10881094
elif res == makeAirfoilRelativeAction:

pymead/gui/dialogs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4302,8 +4302,7 @@ def initializeWidgets(self):
43024302
current_item=get_setting("axis-label-font-family")),
43034303
"label_font_size": PymeadLabeledSpinBox(label="Label Point Size", minimum=1, maximum=100,
43044304
value=get_setting("axis-label-point-size")),
4305-
4306-
4305+
"non_dimensional": PymeadLabeledCheckbox(label="Non-Dim. Axis Labels", initial_state=0)
43074306
}
43084307
if self.current_min_level is not None and self.current_max_level is not None:
43094308
self.widget_dict["min_level"] = PymeadLabeledDoubleSpinBox(

0 commit comments

Comments
 (0)