Skip to content

candlestick edgecolor #5160

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

Closed
wants to merge 3 commits into from
Closed

Conversation

lifetime42
Copy link

This attempts to give the user the option to choose a color for the edge
of a candlestick body and the high-low bars (optional). If no argument is given the behavior is just
like before. It also should fix the vertical line (high-low) zorder so its behind the candlestickbody now.
Idea mainly by jdgd1. I tried to keep existing code working while adding the feature.
#3016
#2546

This attempts to give the user the option to choose a color for the edge
of a candlestick (optional). If no argument is given the behavior is
like before. It also should fix the vertical line (for high-low) zorder
so its behind the candlestickbody now.
@efiring
Copy link
Member

efiring commented Oct 1, 2015

The failures are all PEP8, mostly whitespace, plus some overly long lines.
It would be a good idea to configure your editor to strip all trailing whitespace when saving files.

@@ -682,6 +682,8 @@ def candlestick_ochl(ax, quotes, width=0.2, colorup='k', colordown='r',
the color of the rectangle where close < open
alpha : float
the rectangle alpha level
coloregde : color (optional)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo -> coloredge

@efiring
Copy link
Member

efiring commented Oct 1, 2015

attn: @jdgd1

This attempts to give the user the option to choose a color for the edge
of a candlestick body and the high-low bars (optional). If no argument
is given the behavior is just
like before. It also should fix the vertical line (high-low) zorder so
its behind the candlestickbody now.
Idea mainly by jdgd1. I tried to keep existing code working while adding
the feature.
matplotlib#3016
matplotlib#2546
Hopefully fixed the whitespaces.
@lifetime42
Copy link
Author

Sorry, fixed the typos and whitespaces(hopefully).

Hopefully whitespaces now fixed
@WeatherGod
Copy link
Member

shouldn't we be calling this "edgecolor" in order to follow existing mpl nomenclature?

@tacaswell
Copy link
Member

👍 To matching the naming convention.

@tacaswell tacaswell added this to the next bug fix release (2.0.1) milestone Oct 8, 2015
@lifetime42 lifetime42 changed the title candlestick edge color candlestick edgecolor Nov 17, 2015
@efiring
Copy link
Member

efiring commented May 20, 2016

I suggest a small change to the zorder strategy here. The basic point is that the patch should go above the line instead of below. Since the two go together, however, they should have similar zorders so that the user can easily plot a line (default zorder 2) that lands on top of both or below both. Furthermore, one wants both candlestick zorders to be above the default patch zorder (1), so that the candlesticks will appear on top of bar plots and the like. Two options for the zorders of the candlestick components:

  1. line 1.9, patch 1.91 so that a default independent line will land on top of the candlesticks
  2. line 2.1, patch 2.11 so that a default independent line will land below the candlesticks

@efiring
Copy link
Member

efiring commented May 21, 2016

I recommend option 2 above. I'm guessing that the use case would be to plot something like a scaled stock index as a line or symbols together with the candlestick plot, and that in such a case the index line is a background, and will look best behind the candlesticks. @lifetime42, do you agree, and if so are you available to make that change? It would be nice to get this resolved and merged.

@lifetime42
Copy link
Author

I think having the average in front or in the back depends on wether the
indicators are "supporting" the chart picture or whether the moving
averages (or any other) are to be looked at directly, eg. at crossing
points. could make an argument for both.ill have a look into it

2016-05-22 1:36 GMT+02:00 Eric Firing notifications@github.com:

I recommend option 2 above. I'm guessing that the use case would be to
plot something like a scaled stock index as a line or symbols together with
the candlestick plot, and that in such a case the index line is a
background, and will look best behind the candlesticks. @lifetime42
https://github.com/lifetime42, do you agree, and if so are you
available to make that change? It would be nice to get this resolved and
merged.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5160 (comment)

@efiring
Copy link
Member

efiring commented May 23, 2016

On 2016/05/23 11:36 AM, lifetime42 wrote:

I think having the average in front or in the back depends on wether the
indicators are "supporting" the chart picture or whether the moving
averages (or any other) are to be looked at directly, eg. at crossing
points. could make an argument for both.ill have a look into it

Thanks. It's just a question of which is likely to be most common,
particularly for less-experienced users, and therefore should be the
default. It will always be possible to chose the alternative via an
explicit zorder kwarg to the subsequent plot commands.

@lifetime42
Copy link
Author

The default should be to have the indicators in the front.
Either they are comapred to each other or to the bars for interpretation.

2016-05-23 23:58 GMT+02:00 Eric Firing notifications@github.com:

On 2016/05/23 11:36 AM, lifetime42 wrote:

I think having the average in front or in the back depends on wether the
indicators are "supporting" the chart picture or whether the moving
averages (or any other) are to be looked at directly, eg. at crossing
points. could make an argument for both.ill have a look into it

Thanks. It's just a question of which is likely to be most common,
particularly for less-experienced users, and therefore should be the
default. It will always be possible to chose the alternative via an
explicit zorder kwarg to the subsequent plot commands.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5160 (comment)

@dstansby dstansby modified the milestones: 2.1 (next point release), 2.0.1 (next bug fix release) Mar 17, 2017
@tacaswell tacaswell modified the milestone: 2.1 (next point release) Aug 29, 2017
@anntzer
Copy link
Contributor

anntzer commented Mar 17, 2018

matplotlib.finance is no more (it has been moved to an external library, mpl_finance: https://github.com/matplotlib/mpl_finance).

Feel free to reopen the PR in that repo.

@anntzer anntzer closed this Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants