rem
rem

Reputation: 893

use different pointstyle to demonstrate entities

I have a 3-column data file that looks like

1 01000 1.0438097862355737
2 00100 8.50061570596047e-2
3 00100 7.700237792477498e-2
4 00000 1.1622753275415851
5 00000 1.0247127494489456
6 00100 9.269313130194529e-2
7 01100 7.887103270868287e-2
8 00100 8.718056310114282e-2
9 00100 8.183323639690525e-2
10 10100 8.16226482622277e-2

And I want to plot the 3rd column (y axis) against the 1st (x axis), but also need to use different pointstyles for different values on the 2nd column. Is this possible in gnuplot? I have tried splitting the file according to the 2nd column and plot the files together, but as the bit vector gets bigger this becomes beastly.

The result would look like this

enter image description here

Upvotes: 1

Views: 46

Answers (1)

emptypenny
emptypenny

Reputation: 83

I think you could probably do this using loops and gnuplot's word splitting functions. E.g, with something that looks like:

types="01000 00100 00000..."
plot for [i=1:words(types)] "filename.txt" u ($2==real(word(i))?$1:1/0):2 w p pt i

You could automatically create the types string with something like

types=`awk '{print $2}' filename.txt | sort -g -k1 | uniq | awk '{printf("%s ",$1)}'`

I've not tested these, but it should get you going.

Upvotes: 1

Related Questions