assuming that 'a', 's', and 'z' are the only states, you could read
the y-values in using 'stringcolumn' and test for specific letters:
set yrange [0:4]
set ytics ("a" 1, "s" 2, "z" 3)
plot "datafilename" using
1:(strstrt(stringcolumn(2),"a")?1.0:(strstrt(stringcolumn(2),"s")?2.0:3.0))
with linespoints, "" using
1:(strstrt(stringcolumn(3),"a")?1.0:(strstrt(stringcolumn(3),"s")?2.0:3.0))
with linespoints
Nfjord wrote:
>
> Dear all,
>
> I would like to plot data from a file but the data for the y-axis are
> letters. My data file looks like:
>
> 1 a z
> 2 a a
> 3 z s
> 4 s s
> 5 s a
>
> Column 1 = time (used for x-axis)
> Column 2 = current state of object 1
> Column 3 = current state of object 2
>
> I want to plot the state of the objects versus time, i.e. I want that the
> values of the y-axis are "a", "s", and "z".The problem is that the states
> are letters, not numbers. How can I do to plot this kind of data please?
>
--
View this message in context: http://old.nabble.com/Write-letters-instead-of-numbers-on-y-axis-tp32122377p32123004.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|