0

I've looked all over the net for this incredibly simple thing and can't find it.

I have a list of (x,y) points and want to plot them, with the origin in the lower left, grid marks showing 0,1,2,3,4... on each axis, and orange dots. How do I do this?

1 Answer 1

2

Fairly basic, you should look a bit around in the matplotlib documentation, the examples or gallery section shows a lot of different stuff and the code that generated it.

import matplotlib.pyplot as plt
import numpy as np

#Random sample data
x = np.random.random_integers(0, 5, 10)
y = np.random.random_integers(0, 5, 10)

plt.scatter(x,y, c='orange')
plt.ylim([0, y.max()])
plt.xlim([0, x.max()])
plt.grid()
plt.show()
Sign up to request clarification or add additional context in comments.

2 Comments

already figured it out but thanks, i used plt.xticks and plt.yticks

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.