[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/307bab074
This commit is contained in:
Uwe
2022-06-10 00:33:27 +02:00
committed by GitHub
parent 178eaadfc8
commit fcd606fbff

View File

@@ -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();
}