Python Forum
Removing data in a plot
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing data in a plot
#2
Remove first elements from prediction (and y) with slicing when plotting. You can get length of first split either by directly computing it with
skip_size = len(X) - 10 * (len(X) // (10 + 1))   # for n_splits=10
or by using tcsv.split again (or you could do it in your for loop first iteration ...)
skip_size = len(next(tscv.split(X)[0]))
After that its just
pl.plot(y[skip_size:])
...
pl.plot(prediction[skip_size:], y[skip_size:], 'ro')
Your plot is not piecewise linear, so it seems that your time series is not a time series (= data points in time order).
Reply


Messages In This Thread
Removing data in a plot - by ulrich48155 - Jun-08-2017, 02:25 PM
RE: Removing data in a plot - by zivoni - Jun-08-2017, 09:11 PM
RE: Removing data in a plot - by ulrich48155 - Jun-10-2017, 07:38 PM
RE: Removing data in a plot - by zivoni - Jun-19-2017, 06:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation URGENT: How to plot data from text file. Trying to recreate plots from MATLAB JamieAl 4 3,560 Dec-03-2023, 06:56 AM
Last Post: Pedroski55
  Fit straight line to pandas time series data with semilog plot schniefen 2 1,544 Mar-10-2023, 01:08 PM
Last Post: jefsummers
  Plot time series data schniefen 3 1,335 Mar-04-2023, 04:22 PM
Last Post: noisefloor

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020