Skip to content

Commit 66ffcf9

Browse files
committed
upate ohlc docstring
1 parent 56a1b34 commit 66ffcf9

File tree

1 file changed

+33
-24
lines changed
  • packages/python/plotly/plotly/figure_factory

1 file changed

+33
-24
lines changed

packages/python/plotly/plotly/figure_factory/_ohlc.py

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -132,34 +132,43 @@ def make_decreasing_ohlc(open, high, low, close, dates, **kwargs):
132132

133133
def create_ohlc(open, high, low, close, dates=None, direction="both", **kwargs):
134134
"""
135-
**deprecated**, use instead the plotly.graph_objects trace
136-
:class:`plotly.graph_objects.Ohlc`
137-
138-
:param (list) open: opening values
139-
:param (list) high: high values
140-
:param (list) low: low values
141-
:param (list) close: closing
142-
:param (list) dates: list of datetime objects. Default: None
143-
:param (string) direction: direction can be 'increasing', 'decreasing',
144-
or 'both'. When the direction is 'increasing', the returned figure
145-
consists of all units where the close value is greater than the
146-
corresponding open value, and when the direction is 'decreasing',
147-
the returned figure consists of all units where the close value is
148-
less than or equal to the corresponding open value. When the
149-
direction is 'both', both increasing and decreasing units are
150-
returned. Default: 'both'
151-
:param kwargs: kwargs passed through plotly.graph_objs.Scatter.
152-
These kwargs describe other attributes about the ohlc Scatter trace
153-
such as the color or the legend name. For more information on valid
154-
kwargs call help(plotly.graph_objs.Scatter)
155-
156-
:rtype (dict): returns a representation of an ohlc chart figure.
157-
135+
**Deprecated**. Use [`plotly.graph_objects.Ohlc`][plotly.graph_objects.Ohlc] instead.
136+
137+
Parameters
138+
----------
139+
open : list
140+
Opening values.
141+
high : list
142+
High values.
143+
low : list
144+
Low values.
145+
close : list
146+
Closing values.
147+
dates : list of datetime objects
148+
List of datetime objects. Default is None.
149+
direction : str
150+
Direction can be 'increasing', 'decreasing', or 'both'. When the direction is 'increasing',
151+
the returned figure consists of all units where the close value is greater than the
152+
corresponding open value, and when the direction is 'decreasing', the returned figure
153+
consists of all units where the close value is less than or equal to the corresponding
154+
open value. When the direction is 'both', both increasing and decreasing units are
155+
returned. Default is 'both'.
156+
**kwargs
157+
Additional keyword arguments passed through to `plotly.graph_objs.Scatter`.
158+
These kwargs describe other attributes about the OHLC Scatter trace such as the color
159+
or the legend name. For more information on valid kwargs, call `help(plotly.graph_objs.Scatter)`.
160+
161+
Returns
162+
-------
163+
dict
164+
A representation of an OHLC chart figure.
165+
166+
Examples
167+
--------
158168
Example 1: Simple OHLC chart from a Pandas DataFrame
159169
160170
>>> from plotly.figure_factory import create_ohlc
161171
>>> from datetime import datetime
162-
163172
>>> import pandas as pd
164173
>>> df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
165174
>>> fig = create_ohlc(df['AAPL.Open'], df['AAPL.High'], df['AAPL.Low'], df['AAPL.Close'], dates=df.index)

0 commit comments

Comments
 (0)