7

I am a big fan of Gnuplot and I used it all along my studies for various projects.

Lately I wanted to use Gnuplot to chart some time series like weight loss, exercising results, gas consumptions etc.

Therefore I scale the x-axis like

set xdata time
set timefmt "%d.%m %Y"
set format x "%d.%m"

Now I want to use the fit-function to give me a linear fit. My problem is, that I cannot get that to work if the x-axis is time-related.

1
  • R is probably a better tool for this kind of problem. It is one of most popular languages for data analysis. Plotting is as simple (or simpler) as in gnu plot. Feb 7, 2009 at 1:04

1 Answer 1

3

Then change the date to a number, for example a number of days starting from the first date, make the fit, and then convert the numbers back again into dates. That way you'll have "regular" x and y data set.

1
  • +1 for being the only person to attempt to answer the question, which was "how do I do this in gnuplot". Jan 26, 2017 at 9:50

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.