I want to make a scatter plot using matplotlib. If I want to use any kind of marker the default plotting behavior of matplotlib cuts off the left half of the marker on the left side of the plot, and the right side of the marker on the right side of the plot. I was looking for the most automatic way of adding some extra space to the left and right side of the plot without adding extra tick labels, so my markers aren't cut off and it also doesn't look like there are x-tick labels that don't correspond to any points.

from matplotlib import pyplot as plt
import numpy as np
xx = np.arange(10)
yy = np.random.random( 10 )
plt.plot(xx, yy, 'o' )

This code results in a graph that looks like this:

enter image description here

I'd like full circles at x = 0 and x = 4.5, but I don't want any more tick labels, and I'd like to be the code to be as short and automatic as possible.

Edit
Report