-
-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add transform argument to plots #1036
Changes from 9 commits
218a7ef
6f380df
040a270
da2c817
8e9fe87
91163f0
0a13076
770e8fa
382cc39
1f5b1fe
6aa2d59
f8645de
d877ca4
606e091
72bdd9c
fdb20d6
fbbac6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ def plot_trace( | |
var_names=None, | ||
coords=None, | ||
divergences="bottom", | ||
transform=None, | ||
figsize=None, | ||
rug=False, | ||
lines=None, | ||
|
@@ -46,6 +47,8 @@ def plot_trace( | |
Coordinates of var_names to be plotted. Passed to `Dataset.sel` | ||
divergences : {"bottom", "top", None, False} | ||
Plot location of divergences on the traceplots. Options are "bottom", "top", or False-y. | ||
transform : callable | ||
Function to transform data (defaults to identity) | ||
figsize : figure size tuple | ||
If None, size is (12, variables * 2) | ||
rug : bool | ||
|
@@ -137,6 +140,9 @@ def plot_trace( | |
divergence_data = False | ||
|
||
data = get_coords(convert_to_dataset(data, group="posterior"), coords) | ||
|
||
data = transform(data) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By doing this you are basically writing if transform is not None:
data = transform(data) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aloctavodia Sorry for this elementary mistake! I fixed it. |
||
|
||
var_names = _var_names(var_names, data) | ||
|
||
if lines is None: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a better wording will be "Function to transform data (defaults to None i.e. the identity function)" or probably just "Function to transform data (defaults to None)"