[FEM] fix issue that all plot windows had the same name

- they all had the name "figure 1"
- thus make the name unique and this way also enable to have several plots open displaying different result types (for the line filter)
This commit is contained in:
Uwe
2022-06-10 00:55:02 +02:00
parent 1ce36f6d1b
commit 78ab4ebf4c
3 changed files with 3 additions and 2 deletions

View File

@@ -1252,7 +1252,7 @@ import FreeCAD\n\
from PySide import QtCore\n\
import numpy as np\n\
from matplotlib import pyplot as plt\n\
plt.figure(1)\n\
plt.figure(\"" << titleLabel << "\")\n\
plt.plot(t_coords, membrane, \"k--\")\n\
plt.plot(t_coords, mb, \"b*-\")\n\
plt.plot(t_coords, peak, \"r-x\")\n\

View File

@@ -739,7 +739,7 @@ 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.figure(title)\n\
plt.plot(x, y)\n\
plt.xlabel(\"" << xlabel.toStdString() << "\")\n\
plt.ylabel(title)\n\

View File

@@ -504,6 +504,7 @@ class _TaskPanel:
if len(plt.get_fignums()) > 0:
plt.close()
plt.ioff() # disable interactive mode so we have full control when plot is shown
plt.figure(res_title)
plt.hist(res_values, bins=50, alpha=0.5, facecolor="blue")
plt.xlabel(res_unit)
plt.title(translate("FEM","Histogram of {}").format(res_title))