0

I'm trying to plot a pandas Series, with part of the Series in a different color. Something like this, but I only have two colors:

Example plot

I have a second binary Series that contains 0's and 1's to indicate which points should be colored differently. How could I go about this?

7
  • 1
    There is even a matplotlib example about it. Now it may well be that those linked questions do not help you. In that case you need to edit your question with a specific problem description, see How to Ask. Commented Jun 12, 2017 at 14:13
  • I will have a look at the examples you mention. Either way, I wonder if there is no pandas solution to this. Commented Jun 12, 2017 at 14:18
  • 1
    No there is no "pandas solution", since pandas simply provides wrapper functions to create matplotlib plots and it cannot provide a wrapper for each and every possible case. Commented Jun 12, 2017 at 14:21
  • It depends, you can still edit it to include a minimal reproducible example of the issue with the actual data format you're having and a specific problem description, including in how far the example and linked questions are not helping, in case they aren't or in case you get an error. Commented Jun 12, 2017 at 14:44
  • I have managed to do it with the matplotlib example, I was just hoping for an easier solution because it looked like something trivial to me. Thanks for the help. Commented Jun 12, 2017 at 14:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.