0

I'm a newbie to python. I have time series data for which I need a scatter plot. I basically want the normal and abnormal tags to have different colors. See below images of the data and plot:

Actual data

enter image description here

Expected rearrangement in Data

enter image description here


Expected Plot

enter image description here


I'll be very thankful for any leads in this! Thanks in advance!

1 Answer 1

1

You can use matplotlib.pyplot's scatter

import matplotlib.pyplot as plt

plt.scatter('#normal_TimestampColumn', '#normalColumn', facecolors='b')
plt.scatter('#abnormal_timestampColumn', '#abnormalColumn', facecolors='orange')
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks! But,I only have the data in "actual data" template. I need to rearrange the data with Normal and abnormal columns and then plot
@Unknown You need to edit your question then. What you are asking for now is a bit different from the actual question. You could take a look at pandas dataframe for the rearranging part.
Any idea,how do I write it as a function? For multi color chart

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.