| 292 | } |
| 293 | |
| 294 | void gnuplot::run_command(const std::string &command) { |
| 295 | if (!pipe_.opened()) { |
| 296 | return; |
| 297 | } |
| 298 | size_t pipe_capacity = gnuplot_pipe_capacity(pipe_.file()); |
| 299 | if (command.size() + bytes_in_pipe_ > pipe_capacity) { |
| 300 | flush_commands(); |
| 301 | bytes_in_pipe_ = 0; |
| 302 | } |
| 303 | if (!command.empty()) { |
| 304 | pipe_.write(command); |
| 305 | } |
| 306 | // proc_write(&pipe_, "; "); |
| 307 | pipe_.write("\n"); |
| 308 | bytes_in_pipe_ += command.size(); |
| 309 | if constexpr (trace_commands) { |
| 310 | std::cout << command << std::endl; |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | void gnuplot::include_comment(const std::string &comment) { |
| 315 | if (include_comments_) { |