Read time series and plot it
Code: "time_series2.py". Programming language: Python DMelt Version 1. Last modified: 07/03/2015. License: Pro
https://datamelt.org/code/cache/time_series2_6238.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



from java.awt import Color,Font
from jhplot  import *
from jhpro.tseries import *
 
data= "http://datamelt.org/examples/data/jhpro/tseries/Canadian.dat"
js=HStatData("Title",data)
 
# look at 3rd and 0 columns
p1=js.getP1D(3,0)   # 3rd column for X, 9 column for Y
print p1.toString() # check the data
p1.setDrawLine(1)   # show as connected lines
p1.setTitle("Canadians")
p1.setColor(Color.blue)  # color blue
 
 
# plot the data
c1=HPlot("Canadians")
c1.setNameX("RW")
c1.setNameY("Prod")
c1.visible()
c1.setAutoRange()
c1.draw(p1)

Ads help maintain this website.