I want to do a simple graph, where its points will be assigned by a list (NOT a file) of coordinates.

So, I know, that I can do something like this:

\addplot gnuplot [raw gnuplot, color=blue]{plot "test.dat" };

But I need to use it like this:

\addplot gnuplot [raw gnuplot, color=blue]{plot { (0,0)(1,5)(10,12) } };

It looks pretty easy, but I'm somehow not able to find a single mention of using Pgfplots with gnuplot like this.

So, is it even possible to use it like that? And if it is, then how?


Unfortunately this cannot be done. But to explain why I misuse the answer section.

In gnuplot (alone) this could be done by typing e.g.

plot '-' w p ls 1, '-' w p ls 2, '-' w p ls 3
1 2
2 1
3 1.5

which I simply copied from http://www.gnuplotting.org/plotting-single-points. But when you try to do something similar with PGFPlots raw gnuplot feature like

            \addplot gnuplot [raw gnuplot] {
                plot '-'
                    1 2
                    2 1
                    3 1.5

in a file called minimal.tex, this will result in a corresponding minimal.pgf-plot.gnuplot file

set table "minimal.pgf-plot.table"; set format "%.5f"
set format "%.7e";; plot '-' 1 2 2 1 3 1.5 e 

As you can see, all the line breaks were replaced by spaces and thus results in an empty minimal-pgf-plot.table file which then of course results in an "empty" plot (only the axes are drawn).

image showing the result of above code

  • Even the negative answer is an answer ;-) Thank you! – Eenoku Mar 5 '17 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.