0

I have a dataset that represents the points while creating a circle (multiple circles), like so: enter image description here

    gnuplot <<-EOF
        set autoscale
        plot "$file"  w lp 
EOF

I would like to express the point creation timestamps with colors, so let's give a number to every color, starting from red to blue, from 1 to SAMPLE_COUNT; I need to draw lines between points:

  • #point_0 -> color: 1 -> #point_1
  • #point_1 -> color: 2 -> #point_2

and so on. In the end, I'd like to get something like:

enter image description here

Can we make this with GnuPlot?

1 Answer 1

1

You can do this with variable linecolor (lc) and palette z (check help lc). You are using the pseudocolumn 0 (check help pseudocolumns), i.e. basically the line index, as range for the color palette. If you don't want to see the colorbox add a line unset colorbox.

Script:

### variable line color via palette z
reset session

# create some test data
set table $Data
    plot [0:4*pi] '+' u ($1*cos(x)):($1*sin(x)) w table
unset table

set size ratio -1
set palette defined (0 "red", 1 "orange", 2 "yellow", 3 "green", 4 "cyan", 5 "blue")

plot $Data u 1:2:0 w lp pt 7 lc palette z
### end of script

Result:

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Result is here: i.sstatic.net/Gu5Aa.png Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.