0

I've already seen How to scale the axis in Gnuplot, but I'm not sure how this would work with a function such as

set xrange[-10:10]
f(x) = x**2
plot f(x)

My actual function isn't so easily rescaled as the one above. All I want to do is change the units on the x axis from metres (which is what f(x) accepts), to kilometres.

Community
  • 1
  • 1
hertzsprung
  • 9,445
  • 4
  • 42
  • 77

1 Answers1

3

If your function definition f(x) needs metre and you want your x-axis to display kilometres, then you must scale x by 1000:

set xlabel 'kilometres'
set xrange [-0.01:0.01]
f(x) = x**2
plot f(1000*x)
Christoph
  • 47,569
  • 8
  • 87
  • 187