'How to connect back to back line plots using a dashed line?
I have two datasets covering two different time periods which are back to back. One dataset goes from 0 to 87 and other goes from 88 to 100. Please see below. How do I connect those datasets using a dashed or any distinct line?
My code is as follows:
plt.plot(np.exp(ARIMA.fit.predict(start=88,end=100,dynamic=True)), color = 'red')
plt.plot(np.exp(original_data), color = 'blue')
Solution 1:[1]
I would probably be lazy and do it like this :
fit_array = np.exp(ARIMA.fit.predict(start=88,end=100,dynamic=True))
long_array = np.concatenate([np.exp(original_data), fit_array])
plt.plot(long_array, color = 'blue')
plt.plot(fit_array, color = 'red')
plot the long blue line, which will connect all the points, and then plot the prediction on top.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | bici.sancta |

