matplotplusplus icon indicating copy to clipboard operation
matplotplusplus copied to clipboard

gnuplot 6.0.1 warning: Reading from '-' inside a multiplot not supported; use a datablock instead

Open daljit46 opened this issue 1 year ago • 4 comments

In Gnuplot 6.0.1, the following change was introduced:

CHANGE Use of data source '-' inside a multiplot is an error; use a local datablock instead

This causes an excessive amount of warnings to be output to the console:

warning: Reading from '-' inside a multiplot not supported; use a datablock instead

I can easily reproduce this with the line plot 1 example on MacOS with gnuplot 6.0.1 installed via brew.

daljit46 avatar Nov 23 '24 11:11 daljit46

Yeah i got the same issue, the amount of warnings printed is quite annoying

Haron123 avatar Nov 24 '24 20:11 Haron123

On my 1024x1024 image plot it logs over 30000 warnings per second, rendering application completely unusable.

For a workaround I inserted run_command("unset warnings"); in some place in code.

This is obviously not a fix and I don't know what I am doing. But this worked.

SeverinDenisenko avatar Dec 24 '24 21:12 SeverinDenisenko

Hello, I have also encountered this problem, and it seems to be easy to occur, even with the official code.

#include <cmath>
#include <matplot/matplot.h>

int main() {
    using namespace matplot;
    std::vector<double> x = linspace(0, 2 * pi);
    std::vector<double> y = transform(x, [](auto x) { return sin(x); });

    plot(x, y, "-o");
    hold(on);
    plot(x, transform(y, [](auto y) { return -y; }), "--xr");
    plot(x, transform(x, [](auto x) { return x / pi - 1.; }), "-:gs");
    plot({1.0, 0.7, 0.4, 0.0, -0.4, -0.7, -1}, "k");

    show();
    return 0;
}

I am using the latest version currently available, gunplot 6.0.2, windows C++ 17, matplot++ 5d01eb3. How did you solve this problem later? Can you share? And I didn't know how to operate the run_command in the previous answer, but it seems to have worked. @daljit46 @SeverinDenisenko @Haron123

shen13203708051 avatar May 14 '25 07:05 shen13203708051

Hello, I have also encountered this problem, and it seems to be easy to occur, even with the official code.

#include <cmath>
#include <matplot/matplot.h>

int main() {
    using namespace matplot;
    std::vector<double> x = linspace(0, 2 * pi);
    std::vector<double> y = transform(x, [](auto x) { return sin(x); });

    plot(x, y, "-o");
    hold(on);
    plot(x, transform(y, [](auto y) { return -y; }), "--xr");
    plot(x, transform(x, [](auto x) { return x / pi - 1.; }), "-:gs");
    plot({1.0, 0.7, 0.4, 0.0, -0.4, -0.7, -1}, "k");

    show();
    return 0;
}

I am using the latest version currently available, gunplot 6.0.2, windows C++ 17, matplot++ 5d01eb3. How did you solve this problem later? Can you share? And I didn't know how to operate the run_command in the previous answer, but it seems to have worked. @daljit46 @SeverinDenisenko @Haron123

like so:

    auto f = figure(false);
    f->backend()->run_command("unset warnings");
    f->ioff();
    f->size(1600, 900);
    ...

Xyhlon avatar May 16 '25 16:05 Xyhlon