-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
'closes' and 'lows' misplaced in candlestick chart #6869
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
Changes from all commits
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 |
---|---|---|
|
@@ -1051,7 +1051,7 @@ def candlestick2_ochl(ax, opens, closes, highs, lows, width=4, | |
(lineCollection, barCollection) | ||
""" | ||
|
||
candlestick2_ohlc(ax, opens, highs, closes, lows, width=width, | ||
candlestick2_ohlc(ax, opens, highs, lows, closes, width=width, | ||
colorup=colorup, colordown=colordown, | ||
alpha=alpha) | ||
|
||
|
@@ -1139,8 +1139,8 @@ def candlestick2_ohlc(ax, opens, highs, lows, closes, width=4, | |
ax.autoscale_view() | ||
|
||
# add these last | ||
ax.add_collection(barCollection) | ||
ax.add_collection(rangeCollection) | ||
ax.add_collection(barCollection) | ||
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. What is the reason for swapping the order here? I wouldn't expect it to make any difference, since the difference in zorder should determine the actual drawing 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. every line should be covered by correlative bar, and its part between 'open' and 'close' should not been seen. As showed below: logically, lines first, bars later. it's not enough, bars should be filled with color and cover lines. I'm just learning python here, so i don't know how to do a little further. 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. OK, that would be a good thing to fix. The way to do it is by setting the zorder kwarg of the barCollection to a value above that of the rangeCollection. Where the barCollection is created, add a line right before the ending curly brace: zorder=rangeCollection.get_zorder() + 0.1, 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. @efiring how strongly do you feel about this? I am inclined to merge this as-is. |
||
return rangeCollection, barCollection | ||
|
||
|
||
|
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.
Right!