0

So I am getting stock market data using yahoo_finance python library and I am plotting the data with matplotlib.

I want to color the graph based on if the stock price went up or down. Is it possible to do this with matplotlib? If it goes up: green, if it goes down: red?

1 Answer 1

0

Well you need to apply a function that compare your prices , and when the price is up you apply your green color by plot(x, y, color='green', linestyle='dashed') for example , and yes it's supported on matplotlib , you can find more infos here

https://matplotlib.org/2.1.1/api/_as_gen/matplotlib.pyplot.plot.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.