Skip to content

Commit 18276cf

Browse files
expand docstrings a bit
1 parent bd551c0 commit 18276cf

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

packages/python/plotly/plotly/express/_chart_types.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def density_contour(
128128
z=[
129129
"For `density_heatmap` and `density_contour` these values are used as the inputs to `histfunc`.",
130130
],
131+
histfunc=["The arguments to this function are the values of `z`."],
131132
),
132133
)
133134

@@ -193,6 +194,7 @@ def density_heatmap(
193194
z=[
194195
"For `density_heatmap` and `density_contour` these values are used as the inputs to `histfunc`.",
195196
],
197+
histfunc=["The arguments to this function are the values of `z`.",],
196198
),
197199
)
198200

@@ -396,10 +398,13 @@ def histogram(
396398
histogram.__doc__ = make_docstring(
397399
histogram,
398400
append_dict=dict(
399-
x=["For horizontal histograms, these values are used as inputs to `histfunc`."]
401+
x=["If `orientation` is `'h'`, these values are used as inputs to `histfunc`."]
400402
+ _wide_mode_xy_append,
401-
y=["For vertical histograms, these values are used as inputs to `histfunc`."]
403+
y=["If `orientation` is `'v'`, these values are used as inputs to `histfunc`."]
402404
+ _wide_mode_xy_append,
405+
histfunc=[
406+
"The arguments to this function are the values of `y`(`x`) if `orientation` is `'v'`(`'h'`).",
407+
],
403408
),
404409
)
405410

packages/python/plotly/plotly/express/_doc.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,9 @@
383383
"Sets start angle for the angular axis, with 0 being due east and 90 being due north.",
384384
],
385385
histfunc=[
386-
"str (default `'count'`)",
386+
"str (default `'count'` if no arguments are provided, else `'sum'`)",
387387
"One of `'count'`, `'sum'`, `'avg'`, `'min'`, or `'max'`."
388388
"Function used to aggregate values for summarization (note: can be normalized with `histnorm`).",
389-
"The arguments to this function for `histogram` are the values of `y` if `orientation` is `'v'`,",
390-
"otherwise the arguements are the values of `x`.",
391-
"The arguments to this function for `density_heatmap` and `density_contour` are the values of `z`.",
392389
],
393390
histnorm=[
394391
"str (default `None`)",
@@ -440,8 +437,10 @@
440437
],
441438
zoom=["int (default `8`)", "Between 0 and 20.", "Sets map zoom level."],
442439
orientation=[
443-
"str (default `'v'`)",
444-
"One of `'h'` for horizontal or `'v'` for vertical)",
440+
"str, one of `'h'` for horizontal or `'v'` for vertical. ",
441+
"(default `'v'` if `x` and `y` are provided and both continous or both categorical, ",
442+
"otherwise `'v'`(`'h'`) if `x`(`y`) is categorical and `y`(`x`) is continuous, ",
443+
"otherwise `'v'`(`'h'`) if only `x`(`y`) is provided) ",
445444
],
446445
line_close=[
447446
"boolean (default `False`)",

0 commit comments

Comments
 (0)