Having the following table:
How can we make a plot diagram showing the relation between P,Q? I would like the P-value on y-axis and the Q-values on the x-axis.
pgfplotstabletikz-pgf
Having the following table:
How can we make a plot diagram showing the relation between P,Q? I would like the P-value on y-axis and the Q-values on the x-axis.
Best Answer
Here's a minimal example:
Assuming you have the data in a file (I called the file
data.dat
):Use the code:
Check out the documentation for
pgfplots
. It's very well suited to creating graphs. I've only demonstrated the most basic possibilities. But it has a lot of power.Note if you're going to use the package
pgfplotstable
then, technically, there's no need to loadpgfplots
. But, if you don't usepgfplotstable
then be sure to loadpgfplots
to be able to graph your data.