FEM: Enable translation of axis label

This commit is contained in:
Chris Hennes
2022-06-07 13:10:42 -05:00
parent 47bb1408da
commit 6449e1bcf7

View File

@@ -732,16 +732,19 @@ void TaskPostDataAlongLine::on_VectorMode_activated(int i) {
}
std::string TaskPostDataAlongLine::Plot() {
return "import FreeCAD\n\
auto xlabel = tr("Length", "X-Axis plot label");
std::ostringstream oss;
oss << "import FreeCAD\n\
import numpy as np\n\
from matplotlib import pyplot as plt\n\
plt.figure(1)\n\
plt.plot(x, y)\n\
plt.xlabel(\"Length\")\n\
plt.xlabel(\"" << xlabel.toStdString() << "\")\n\
plt.ylabel(title)\n\
plt.title(title)\n\
plt.grid()\n\
plt.show()\n";
return oss.str();
}
// ***************************************************************************