Skip to content

Commit

Permalink
Plot based on similarity values
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Dec 29, 2024
1 parent 093040f commit 0428eca
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions example/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ def main(argv=None):
title='Offset values',
)
fig.add_hline(
annotation_text='offset_mean',
annotation_text='mean',
y=values['offset_mean'],
line_color='#cc0',
)
fig.add_hline(
annotation_text='offset_upper',
annotation_text='upper',
y=values['offset_upper'],
line_color='#0c0',
)
fig.add_hline(
annotation_text='offset_lower',
annotation_text='lower',
y=values['offset_lower'],
line_color='#c00',
)
Expand All @@ -124,7 +124,33 @@ def main(argv=None):
fig.show()

if args.plot_simil:
pass # TODO
fig = px.line(
data,
x='date',
y='simil',
template='plotly_dark',
title='Similarity values',
)
fig.add_hline(
annotation_text='mean',
y=0,
line_color='#cc0',
)
fig.add_hline(
annotation_text='upper',
y=1,
line_color='#0c0',
)
fig.add_hline(
annotation_text='lower',
y=-1,
line_color='#c00',
)
fig.add_vline(
annotation_text='today',
x=dt.combine(data[-1]['date'], dt.min.time()).timestamp() * 1000,
line_color='#0cc',
)
fig.show()

return 0
Expand Down

0 comments on commit 0428eca

Please sign in to comment.