From c4fec57368db4b2b45b3dc6b2f552115b2c8bbe5 Mon Sep 17 00:00:00 2001 From: Uwe Date: Fri, 10 Jun 2022 00:33:27 +0200 Subject: [PATCH] [FEM] fix linear filter plot (#6999) * [FEM] fix linear filter plot the plot one can create from within the linear filter is at the moment detached from FreeCAD's main window. This PR fixes it the same way as in https://github.com/FreeCAD/FreeCAD/commit/920e8e046 --- src/Mod/Fem/Gui/TaskPostBoxes.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index c953463631..d6a8d844a8 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -735,14 +735,19 @@ std::string TaskPostDataAlongLine::Plot() { auto xlabel = tr("Length", "X-Axis plot label"); std::ostringstream oss; oss << "import FreeCAD\n\ +from PySide import QtCore\n\ import numpy as np\n\ from matplotlib import pyplot as plt\n\ +plt.ioff()\n\ plt.figure(1)\n\ plt.plot(x, y)\n\ plt.xlabel(\"" << xlabel.toStdString() << "\")\n\ plt.ylabel(title)\n\ plt.title(title)\n\ plt.grid()\n\ +fig_manager = plt.get_current_fig_manager()\n\ +fig_manager.window.setParent(FreeCADGui.getMainWindow())\n\ +fig_manager.window.setWindowFlag(QtCore.Qt.Tool)\n\ plt.show()\n"; return oss.str(); }