Skip to content

Opening the gnuplot failed: pipe: Too many open files #455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks
steppenhahni opened this issue Apr 7, 2025 · 1 comment
Open
5 tasks

Opening the gnuplot failed: pipe: Too many open files #455

steppenhahni opened this issue Apr 7, 2025 · 1 comment

Comments

@steppenhahni
Copy link

Bug category

  • bug - compilation error
  • bug - compilation warning
  • [x ] bug - runtime error
  • bug - runtime warning
  • bug - logic error

Describe the bug
Hi, I really like the library you created. I found a problem when creating a lot of plots.
If a lot of plots are created silently and then saved, matplot seems not to close the file connections.

Steps to Reproduce

My minimal working example is:

#include
#include <matplot/matplot.h>
int main() {

using namespace matplot;

for (int i = 0; i < 1000; i++) {
	std::vector<double> a = {1.0,2.0,3.0,4.0};
	std::vector<double> b = {1.0,2.0,3.0,4.0};

	auto fig = figure(true);
	fig->size(1200, 800);
	auto ax = axes(fig);
	ax -> plot(a,b);
	save("test" + std::to_string(i) + ".svg");

}

}

Output

After around 251 plots (depends on system, I think), I get this console output for all following plots:

Opening the gnuplot failed: pipe: Too many open files
Please install gnuplot 5.2.6+: http://www.gnuplot.info

Platform

  • cross-platform issue - linux
  • [ x] cross-platform issue - windows
  • [x ] cross-platform issue - macos

Environment Details:

  • OS: MacOS
  • OS Version: Sonoma 14.4
  • Compiler: g++-14 (cstd-20)
  • Compiler version:

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@steppenhahni and others