-
Notifications
You must be signed in to change notification settings - Fork 660
Change plot color #340
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
Comments
The That said, I belive what you are looking for will be handled by the following enhancement: #205 (comment) Let me know if that is what you are looking for. |
@geirak ... I just realized that you already commented on the above mentioned enhancement. However you bring up an interesting point. Until that enhancement is implemented, it may be possible to use |
@DanielGoldfarb The workaround you mention sounds like something I am looking (I saw it in one of your examples files) into for another thing I need. Here is an example of what I am looking for: Is it is possible to control the color of a line plot on a bar by bar basis. See attached screen shot (Ninja Trader), where you can see that the slow line changes color when the fast yellow line crosses the slow line. I can deal with all the logic, I just need to pass in the colors on a bar by bar basis (sorry about all the edits...) |
@geirak |
@DanielGoldfarb Thank you Daniel for your excellent help!!! |
@DanielGoldfarb Daniel - I just wanted to give feedback to show that your proposal works. Assuming that there are already columns for the plot value ("D") and a column for the plot color ("dcolor") I created two new columns "dbull" and "dbear", which were filled with values only for the corresponding color. I noticed that there would always be a gap in the plot when the color changed, so I had to ensure that there was an overlap at the color change. Below a couple of excerpts from how I solved it. I am very new to Python and pandas, so I am sure there are better ways to accomplish this Axis etc. still need some more work... |
@geirak |
Hi
I have an indicator where I would like to change plot color based on certain criteria indicating a bullish or bearish scenario. Is it possible to specify colors per bar with the mpf.make_addplot color parameter, or can only one color be passed in?
Regards
Geir
The text was updated successfully, but these errors were encountered: