Skip to content

Commit

Permalink
Introduced latest_date variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Dec 29, 2024
1 parent 0428eca commit 076bfad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions example/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def main(argv=None):
data = list(load_data(file_in_data))
values = load_values(file_in_values)

latest_date = data[-1]['date']

if args.plot_rate:
fig = px.line(
data,
Expand All @@ -88,7 +90,7 @@ def main(argv=None):
)
fig.add_vline(
annotation_text='today',
x=dt.combine(data[-1]['date'], dt.min.time()).timestamp() * 1000,
x=dt.combine(latest_date, dt.min.time()).timestamp() * 1000,
line_color='#0cc',
)
fig.show()
Expand Down Expand Up @@ -118,7 +120,7 @@ def main(argv=None):
)
fig.add_vline(
annotation_text='today',
x=dt.combine(data[-1]['date'], dt.min.time()).timestamp() * 1000,
x=dt.combine(latest_date, dt.min.time()).timestamp() * 1000,
line_color='#0cc',
)
fig.show()
Expand Down Expand Up @@ -148,7 +150,7 @@ def main(argv=None):
)
fig.add_vline(
annotation_text='today',
x=dt.combine(data[-1]['date'], dt.min.time()).timestamp() * 1000,
x=dt.combine(latest_date, dt.min.time()).timestamp() * 1000,
line_color='#0cc',
)
fig.show()
Expand Down

0 comments on commit 076bfad

Please sign in to comment.