1

I have used the following code to generate the graph as shown. My data set is stored in "tot.dos".

set autoscale
unset log
unset label
set xtic auto
set ytic auto
set xlabel "X"
set ylabel "Y"
set arrow 1 from 3.44,0 to 3.44,150 nohead ls 10 dt 2 lw 2 lc 'red'
set xrange [-1.5:9]
set yrange [0:150]
plot "tot.dos" using 1:2 w l lw 2 lc 'blue' title 'Total'
pause -1 "Hit any key to continue \n"

enter image description here

In this plot, the point at which "Total" is zero (let's consider it to be the centre of the graph), is approximately x=4. Now, I want to shift this entire plot to the left (along -x direction) so that the new centre of the graph is at x=0. Is there any way I can do it?

I thought adding an extra line x=x-4 would work, but it didn't. I use Ubuntu 20.04. Also, please ignore the red dashed line, it might be confusing.

1 Answer 1

2

Assuming I understood your question correctly, you want to shift your data by 4 to the left. So, what about the following which subtracts 4 from all x values?

plot "tot.dos" using ($1-4):2
Sign up to request clarification or add additional context in comments.

Comments

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.