-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
finance ochl->ohlc #1920
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
finance ochl->ohlc #1920
Changes from 1 commit
2c4727a
8745e3a
f16dc47
ffb2074
35d70d8
4ab6b95
4ee6d2e
428333d
e509cd2
9c5e1c3
ca8845e
45eea6e
10adeb2
96b859f
f4dcc2f
c8fcc1a
a92039b
1def459
e4fab5d
469e267
007754c
58d741f
62f4e19
4ef8ac9
4c76044
1e39c0c
ca81f16
e772ac4
c4819c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Added deprecation warning to `plot_day_summary2` and returned call signature to what it was. Added alias `plot_day_summary_ochl` with same call signature as `plot_day_summary2`. renamed the modified function to `plot_day_summary_ohlc`. The first two functions simply call the third with the arguments re-ordered.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
from matplotlib.patches import Rectangle | ||
from matplotlib.transforms import Affine2D | ||
|
||
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation | ||
|
||
cachedir = get_cachedir() | ||
# cachedir will be None if there is no writable directory. | ||
|
@@ -374,11 +375,62 @@ def candlestick(ax, quotes, width=0.2, colorup='k', colordown='r', | |
return lines, patches | ||
|
||
|
||
def plot_day_summary2(ax, opens, highs, lows, closes ticksize=4, | ||
def plot_day_summary2(ax, opens, closes, highs, lows, ticksize=4, | ||
colorup='k', colordown='r', | ||
): | ||
""" | ||
|
||
Represent the time, open, close, high, low, as a vertical line | ||
ranging from low to high. The left tick is the open and the right | ||
tick is the close. | ||
|
||
ax : an Axes instance to plot to | ||
ticksize : size of open and close ticks in points | ||
colorup : the color of the lines where close >= open | ||
colordown : the color of the lines where close < open | ||
|
||
return value is a list of lines added | ||
""" | ||
|
||
warnings.warn("This function has been deprecated in 1.3 in favor" | ||
"of `plot_day_summary_ochl`," | ||
"which maintains the natural argument order," | ||
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. Isn't it confusing to call this the "natural argument order", when everything is being converted to the standard financial industry order (if I understand correctly)? Maybe just call it the "original matplotlib argument order"? Or is there some larger rationale or citation for calling it "natural"? (To me, as a non-financial person, it does seem quite natural--but since this is a function for financial people, what seems natural to me is completely irrelevant.) 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. I'll take the editorial comment out. |
||
"or `plot_day_summary_ohlc`," | ||
"which uses the open-high-low-close order." | ||
"This function will be removed in 1.4", mplDeprecation) | ||
return plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize, | ||
colorup, colordown) | ||
|
||
|
||
def plot_day_summary_ochl(ax, opens, closes, highs, lows, ticksize=4, | ||
colorup='k', colordown='r', | ||
): | ||
|
||
""" | ||
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. As much as possible, try using the new MEP10 conventions for the documentation. It corresponds to numpydoc's formatting. More detail can be found here: https://github.com/matplotlib/matplotlib/wiki/Mep10 |
||
|
||
Represent the time, open, close, high, low, as a vertical line | ||
ranging from low to high. The left tick is the open and the right | ||
tick is the close. | ||
|
||
ax : an Axes instance to plot to | ||
ticksize : size of open and close ticks in points | ||
colorup : the color of the lines where close >= open | ||
colordown : the color of the lines where close < open | ||
|
||
return value is a list of lines added | ||
""" | ||
|
||
return plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize, | ||
colorup, colordown) | ||
|
||
|
||
|
||
def plot_day_summary_ohlc(ax, opens, highs, lows, closes, ticksize=4, | ||
colorup='k', colordown='r', | ||
): | ||
|
||
""" | ||
|
||
Represent the time, open, high, low, close as a vertical line | ||
ranging from low to high. The left tick is the open and the right | ||
tick is the close. | ||
|
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.
it is best to import this from the cbook module.