Describe the bug
When creating a figure from a GUI app on windows, in order to generate quietly a plot and save the resulting output as an image, a terminal gets opened.
The problem does not exists if we run the library in a console program.
Steps to Reproduce
{
auto f = matplot::figure(true); //opens a terminal that is visible, despite having chosen quiet mode.
...
f->save(filename);
}
Dirty fix
{
auto f = matplot::figure(true); //opens a terminal that is visible, despite having chosen quiet mode.
...
f->save(filename);
f->backend({}); // dirty patch to close the console opened when matplot++ is called from a GUI, and not a console
}
Bug category
Describe the bug When creating a figure from a GUI app on windows, in order to generate quietly a plot and save the resulting output as an image, a terminal gets opened.
The problem does not exists if we run the library in a console program.
Steps to Reproduce
Dirty fix
Platform
Environment Details:
Is seems that the issue is related to the use of
_popen
: https://github.com/alandefreitas/matplotplusplus/blob/a40344efa9dc5ea0c312e6e9ef4eb7238d98dc12/source/matplot/backend/gnuplot.cpp#L76It seems that
_popen
cannot hide windows, as we can read here https://stackoverflow.com/a/10020726/18371648So we should use
CreateProcess
instead of_popen