I want to have a single line on the plot, that changes colors in given range. I tried something like this:
set palette defined (0.0 '#01748D', 0.1 '#22D6CC', 0.2 '#68DEFF', 0.3 '#2E5DD1', \
0.4 '#2E5DD1', 0.5 '#611EBA', 0.6 '#9349DF', 0.7 '#611EBA', \
0.8 '#BF1E90', 0.9 '#FA6FD3')
set cbrange [100:350]
set colorbox horiz user origin 0.22,0.65 size 0.335,0.04
set cbtics 100 offset 0,2.3
set format cb '\scriptsize{$%1.0f$}'
set palette maxcolor 40
set style data lines
plot 'dane.dat' using 1:2:(($1-100)/(350-100)) with lines lc palette lw 3 notitle
but it didn't work. I tried ChatGPT tricks, but nothing worked, so at this point I think it's impossible. But some of you are smarter, so please, let me know!
I want to have a single line on the plot, that changes colors in given range. I tried something like this:
set palette defined (0.0 '#01748D', 0.1 '#22D6CC', 0.2 '#68DEFF', 0.3 '#2E5DD1', \
0.4 '#2E5DD1', 0.5 '#611EBA', 0.6 '#9349DF', 0.7 '#611EBA', \
0.8 '#BF1E90', 0.9 '#FA6FD3')
set cbrange [100:350]
set colorbox horiz user origin 0.22,0.65 size 0.335,0.04
set cbtics 100 offset 0,2.3
set format cb '\scriptsize{$%1.0f$}'
set palette maxcolor 40
set style data lines
plot 'dane.dat' using 1:2:(($1-100)/(350-100)) with lines lc palette lw 3 notitle
but it didn't work. I tried ChatGPT tricks, but nothing worked, so at this point I think it's impossible. But some of you are smarter, so please, let me know!
Share Improve this question asked Nov 18, 2024 at 10:51 Lilla_muLilla_mu 114 bronze badges 2 |1 Answer
Reset to default 1You are on the right track. I am guessing that you are not setting the cbrange correctly to match the actual 3rd column values. Here is a simple example the uses plot '+'
to dummy up a data file consisting of 100 evenly space data points between 1 and 10.
set palette rgbformulae 33,13,10
set sample 100
set xrange [0:10]
plot '+' using ($1) : (sin($1)/$1) : ($1) with lines lw 3 lc palette notitle
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745624602a4636730.html
set cbrange [*:*]
? – Ethan Commented Nov 18, 2024 at 17:17