1

I am plotting two lists on the Y and X axis:

Y-list

1
1
1
1
2
2
3
3

X-list

2015-07-08 00:00:00
2018-02-05 00:00:00
2018-02-05 00:00:00
2018-03-08 00:00:00
2018-03-08 00:00:00
2019-07-30 00:00:00
2019-07-30 00:00:00
2019-11-18 15:00:00

In the final graph I would like to display a time-hisotry. Do you know how I can replace the single Y-values with names/strings (Generator1, Generator2, Generator3). See picture.

Thank you!

enter image description here

1 Answer 1

2

You can use yticks for this https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.yticks.html

for example

yticks(np.arange(5), ('Generator1', 'Generator2', 'Generator3', '4', '5'))
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.