Skip to content

Commit 056e510

Browse files
committed
update docstring
1 parent 409d5b7 commit 056e510

File tree

1 file changed

+35
-42
lines changed
  • packages/python/plotly/plotly/figure_factory

1 file changed

+35
-42
lines changed

packages/python/plotly/plotly/figure_factory/_bullet.py

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -195,50 +195,45 @@ def create_bullet(
195195
**layout_options,
196196
):
197197
"""
198-
**deprecated**, use instead the plotly.graph_objects trace
199-
:class:`plotly.graph_objects.Indicator`.
200-
201-
:param (pd.DataFrame | list | tuple) data: either a list/tuple of
202-
dictionaries or a pandas DataFrame.
203-
:param (str) markers: the column name or dictionary key for the markers in
204-
each subplot.
205-
:param (str) measures: the column name or dictionary key for the measure
206-
bars in each subplot. This bar usually represents the quantitative
207-
measure of performance, usually a list of two values [a, b] and are
208-
the blue bars in the foreground of each subplot by default.
209-
:param (str) ranges: the column name or dictionary key for the qualitative
210-
ranges of performance, usually a 3-item list [bad, okay, good]. They
198+
**Deprecated**. Use [`plotly.graph_objects.Indicator`][plotly.graph_objects.Indicator] instead.
199+
200+
Parameters
201+
----------
202+
data : pd.DataFrame or list or tuple
203+
Either a list/tuple of dictionaries or a pandas DataFrame.
204+
markers : str
205+
The column name or dictionary key for the markers in each subplot.
206+
measures : str
207+
The column name or dictionary key for the measure bars in each subplot. This bar usually represents the quantitative
208+
measure of performance, usually a list of two values [a, b] and are the blue bars in the foreground of each subplot by default.
209+
ranges : str
210+
The column name or dictionary key for the qualitative ranges of performance, usually a 3-item list [bad, okay, good]. They
211211
correspond to the grey bars in the background of each chart.
212-
:param (str) subtitles: the column name or dictionary key for the subtitle
213-
of each subplot chart. The subplots are displayed right underneath
214-
each title.
215-
:param (str) titles: the column name or dictionary key for the main label
216-
of each subplot chart.
217-
:param (bool) orientation: if 'h', the bars are placed horizontally as
218-
rows. If 'v' the bars are placed vertically in the chart.
219-
:param (list) range_colors: a tuple of two colors between which all
220-
the rectangles for the range are drawn. These rectangles are meant to
221-
be qualitative indicators against which the marker and measure bars
222-
are compared.
223-
Default=('rgb(200, 200, 200)', 'rgb(245, 245, 245)')
224-
:param (list) measure_colors: a tuple of two colors which is used to color
225-
the thin quantitative bars in the bullet chart.
226-
Default=('rgb(31, 119, 180)', 'rgb(176, 196, 221)')
227-
:param (float) horizontal_spacing: see the 'horizontal_spacing' param in
228-
plotly.tools.make_subplots. Ranges between 0 and 1.
229-
:param (float) vertical_spacing: see the 'vertical_spacing' param in
230-
plotly.tools.make_subplots. Ranges between 0 and 1.
231-
:param (dict) scatter_options: describes attributes for the scatter trace
232-
in each subplot such as name and marker size. Call
233-
help(plotly.graph_objs.Scatter) for more information on valid params.
234-
:param layout_options: describes attributes for the layout of the figure
235-
such as title, height and width. Call help(plotly.graph_objs.Layout)
236-
for more information on valid params.
237-
212+
subtitles : str
213+
The column name or dictionary key for the subtitle of each subplot chart. The subplots are displayed right underneath each title.
214+
titles : str
215+
The column name or dictionary key for the main label of each subplot chart.
216+
orientation : bool
217+
If 'h', the bars are placed horizontally as rows. If 'v' the bars are placed vertically in the chart.
218+
range_colors : list
219+
A tuple of two colors between which all the rectangles for the range are drawn. These rectangles are meant to be qualitative
220+
indicators against which the marker and measure bars are compared. Default is ('rgb(200, 200, 200)', 'rgb(245, 245, 245)').
221+
measure_colors : list
222+
A tuple of two colors which is used to color the thin quantitative bars in the bullet chart. Default is ('rgb(31, 119, 180)', 'rgb(176, 196, 221)').
223+
horizontal_spacing : float
224+
See the 'horizontal_spacing' param in plotly.tools.make_subplots. Ranges between 0 and 1.
225+
vertical_spacing : float
226+
See the 'vertical_spacing' param in plotly.tools.make_subplots. Ranges between 0 and 1.
227+
scatter_options : dict
228+
Describes attributes for the scatter trace in each subplot such as name and marker size. Call help(plotly.graph_objs.Scatter) for more information on valid params.
229+
layout_options
230+
Describes attributes for the layout of the figure such as title, height and width. Call help(plotly.graph_objs.Layout) for more information on valid params.
231+
232+
Examples
233+
--------
238234
Example 1: Use a Dictionary
239235
240236
>>> import plotly.figure_factory as ff
241-
242237
>>> data = [
243238
... {"label": "revenue", "sublabel": "us$, in thousands",
244239
... "range": [150, 225, 300], "performance": [220,270], "point": [250]},
@@ -251,7 +246,6 @@ def create_bullet(
251246
... {"label": "Satisfaction", "sublabel": "out of 5","range": [3.5, 4.25, 5],
252247
... "performance": [3.2, 4.7], "point": [4.4]}
253248
... ]
254-
255249
>>> fig = ff.create_bullet(
256250
... data, titles='label', subtitles='sublabel', markers='point',
257251
... measures='performance', ranges='range', orientation='h',
@@ -264,7 +258,6 @@ def create_bullet(
264258
>>> import plotly.figure_factory as ff
265259
>>> import pandas as pd
266260
>>> data = pd.read_json('https://cdn.rawgit.com/plotly/datasets/master/BulletData.json')
267-
268261
>>> fig = ff.create_bullet(
269262
... data, titles='title', markers='markers', measures='measures',
270263
... orientation='v', measure_colors=['rgb(14, 52, 75)', 'rgb(31, 141, 127)'],

0 commit comments

Comments
 (0)