Skip to content

Commit

Permalink
Improved bokeh plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Risien committed May 9, 2020
1 parent 2fc7e0f commit 0dd937c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 30 deletions.
10 changes: 5 additions & 5 deletions python/Arkansas_hybrid_pcp_index.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions python/addtional_examples/Iowa_hybrid_pcp_index.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions python/addtional_examples/Washington_hybrid_pcp_index.html

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions python/addtional_examples/hybrid_index_example_script_iowa.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
import pandas as pd
from bokeh.plotting import figure, output_file, show
import hybrid_pcp_index
import numpy as np

#load Iowa precipiation anomalies and PDSI time series
df = pd.read_csv (r'pcp_pdsi_iowa.csv')
pcp00 = df.values[:,2];
pdsi = df.values[:,3];
#rename year col. and convert to datetime
df = df.rename(columns={'%year':'year'})
df.insert(2,"day",list(np.ones(833).astype(int)),True)
datetime = pd.to_datetime(df[['year','month','day']])

#load f^-1 spectrum
evapo = pd.read_csv (r'evapo.csv')
Expand All @@ -38,9 +43,9 @@

#Plot the results for Iowa
output_file("Iowa_hybrid_pcp_index.html", title="Iowa")
plot = figure(title= "Iowa", x_axis_label= 'time', y_axis_label= 'index')
plot.line(list(range(833)), pcpexp3, legend_label="Tau03", line_color="black", line_width = 2)
plot.line(list(range(833)), pcpexp10, legend_label="Tau10", line_color="blue", line_width = 2)
plot.line(list(range(833)), pcpexp20, legend_label="Tau20", line_color="green", line_width = 2)
plot.line(list(range(833)), pcpexp36, legend_label="Tau36", line_color="red", line_width = 2)
plot = figure(title= "Iowa", x_axis_type='datetime', x_axis_label= 'time', y_axis_label= 'index')
plot.line(datetime, pcpexp3, legend_label="Tau03", line_color="black", line_width = 2)
plot.line(datetime, pcpexp10, legend_label="Tau10", line_color="blue", line_width = 2)
plot.line(datetime, pcpexp20, legend_label="Tau20", line_color="green", line_width = 2)
plot.line(datetime, pcpexp36, legend_label="Tau36", line_color="red", line_width = 2)
show(plot)
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
import pandas as pd
from bokeh.plotting import figure, output_file, show
import hybrid_pcp_index
import numpy as np

#load Washington precipiation anomalies and PDSI time series
df = pd.read_csv (r'pcp_pdsi_washington.csv')
pcp00 = df.values[:,2];
pdsi = df.values[:,3];
#rename year col. and convert to datetime
df = df.rename(columns={'%year':'year'})
df.insert(2,"day",list(np.ones(833).astype(int)),True)
datetime = pd.to_datetime(df[['year','month','day']])

#load f^-1 spectrum
evapo = pd.read_csv (r'evapo.csv')
Expand All @@ -38,9 +43,9 @@

#Plot the results for Washington
output_file("Washington_hybrid_pcp_index.html", title="Washington")
plot = figure(title= "Washington", x_axis_label= 'time', y_axis_label= 'index')
plot.line(list(range(833)), pcpexp3, legend_label="Tau03", line_color="black", line_width = 2)
plot.line(list(range(833)), pcpexp10, legend_label="Tau10", line_color="blue", line_width = 2)
plot.line(list(range(833)), pcpexp20, legend_label="Tau20", line_color="green", line_width = 2)
plot.line(list(range(833)), pcpexp36, legend_label="Tau36", line_color="red", line_width = 2)
plot = figure(title= "Washington", x_axis_type='datetime', x_axis_label= 'time', y_axis_label= 'index')
plot.line(datetime, pcpexp3, legend_label="Tau03", line_color="black", line_width = 2)
plot.line(datetime, pcpexp10, legend_label="Tau10", line_color="blue", line_width = 2)
plot.line(datetime, pcpexp20, legend_label="Tau20", line_color="green", line_width = 2)
plot.line(datetime, pcpexp36, legend_label="Tau36", line_color="red", line_width = 2)
show(plot)
15 changes: 10 additions & 5 deletions python/hybrid_index_example_script_arkansas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
import pandas as pd
from bokeh.plotting import figure, output_file, show
import hybrid_pcp_index
import numpy as np

#load Arkansas precipiation anomalies and PDSI time series
df = pd.read_csv (r'pcp_pdsi_arkansas.csv')
pcp00 = df.values[:,2];
pdsi = df.values[:,3];
#rename year col. and convert to datetime
df = df.rename(columns={'%year':'year'})
df.insert(2,"day",list(np.ones(833).astype(int)),True)
datetime = pd.to_datetime(df[['year','month','day']])

#load f^-1 spectrum
evapo = pd.read_csv (r'evapo.csv')
Expand All @@ -38,9 +43,9 @@

#Plot the results for Arkansas
output_file("Arkansas_hybrid_pcp_index.html", title="Arkansas")
plot = figure(title= "Arkansas", x_axis_label= 'time', y_axis_label= 'index')
plot.line(list(range(833)), pcpexp3, legend_label="Tau03", line_color="black", line_width = 2)
plot.line(list(range(833)), pcpexp10, legend_label="Tau10", line_color="blue", line_width = 2)
plot.line(list(range(833)), pcpexp20, legend_label="Tau20", line_color="green", line_width = 2)
plot.line(list(range(833)), pcpexp36, legend_label="Tau36", line_color="red", line_width = 2)
plot = figure(title= "Arkansas", x_axis_type='datetime', x_axis_label= 'time', y_axis_label= 'index')
plot.line(datetime, pcpexp3, legend_label="Tau03", line_color="black", line_width = 2)
plot.line(datetime, pcpexp10, legend_label="Tau10", line_color="blue", line_width = 2)
plot.line(datetime, pcpexp20, legend_label="Tau20", line_color="green", line_width = 2)
plot.line(datetime, pcpexp36, legend_label="Tau36", line_color="red", line_width = 2)
show(plot)

0 comments on commit 0dd937c

Please sign in to comment.