Skip to content

Commit

Permalink
Consistent chart height
Browse files Browse the repository at this point in the history
  • Loading branch information
s2t2 committed Nov 4, 2024
1 parent 33d39b8 commit 62002d1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/notes/applied-stats/summary-stats.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import plotly.express as px
# https://plotly.com/python-api-reference/generated/plotly.express.box.html
px.box(df, x="fed", orientation="h", points="all",
title="Distribution of Federal Funds Rate (Monthly)",
hover_data=["timestamp"]
hover_data=["timestamp"], height=400
)
```

Expand All @@ -85,20 +85,18 @@ A violin plot:
# https://plotly.com/python-api-reference/generated/plotly.express.violin.html
px.violin(df, x="fed", orientation="h", points="all", box=True,
title="Distribution of Federal Funds Rate (Monthly)",
hover_data=["timestamp"]
hover_data=["timestamp"], height=400
)
```

A histogram:
```{python}
# https://plotly.com/python-api-reference/generated/plotly.express.histogram.html
px.histogram(df, x="fed", #nbins=12,
title="Distribution of Federal Funds Rate (Monthly)", height=350)
title="Distribution of Federal Funds Rate (Monthly)", height=400)
```

When we make a histogram, we can specify the number of bins, using the `nbins` parameter.

These charts help us visually identify distributions in the data.

Based on this view, is hard to say for sure if this data is normally distributed, or multi-modal, or whether it is too skewed by the outliers. In the next chapter, we will perform more official statistical tests to determine if this data is normally distributed.

0 comments on commit 62002d1

Please sign in to comment.