Skip to content

Commit

Permalink
removed stacking from drawdown plot
Browse files Browse the repository at this point in the history
  • Loading branch information
viventriglia committed Oct 26, 2024
1 parent b9e20e0 commit 7f77158
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def plot_correlation_map(

def plot_returns(
df: pd.DataFrame, annotation_text: str = "", min_resolution: float = 0.005
) -> go.Figure():
) -> go.Figure:
n_bins = int(np.ceil((abs(df.max() - df.min()).div(min_resolution)).max()))

fig = px.histogram(df, barmode="overlay", nbins=n_bins)
Expand Down Expand Up @@ -144,7 +144,9 @@ def plot_returns(

def plot_drawdown(df: pd.DataFrame) -> go.Figure:
fig = px.area(data_frame=df)
fig.update_traces(hovertemplate="%{x}: <b>%{y:.1%}</b>")
fig.update_traces(
hovertemplate="%{x}: <b>%{y:.1%}</b>", stackgroup=None, fill="tozeroy"
)
fig.update_layout(
autosize=False,
height=600,
Expand Down

0 comments on commit 7f77158

Please sign in to comment.