0
votes

I have a file with data like this

#temp density press
1.0   0.03    0.001
1.0   0.03    0.002
.
.
.

The first column is the temperature. I would like to plot isotherms in state equation graph fashion

This means making a graph u 2:3 with multiple lines, each line corresponding to a value of the temperature. When I searched how to do this I found everyone made like a heat map with colors. I don't want that, I want just the lines.

How do I do this?

1

1 Answers

0
votes

Although I may not understand your data format correctly, it sounds like you want something like this. To plot the lines that have temp=1.0

  plot DATA using ($1==1.0 ? $2 : NaN) : 3 with lines

If you know the exact values of the temperatures in advance you could string a set of these together into a single plot. Suppose temperatures 1.0 100.0 200.0

  set style data lines
  plot DATA using ($1==1.0 ? $2 : NaN) : 3, \
         '' using ($1==100.0 ? $2 : Nan) : 3, \
         '' using ($1==200.0 ? $2 : Nan) : 3

A better option is to separate the blocks of data in your input file with a blank line wherever the temperature changes. Then you can catch each separate temperature block in a separate line with a distinct color or dash pattern:

  set style data lines
  plot for [block=0:*] DATA index=block using 2:3