0

So using matplotlib scatter plot, i am getting a plot that looks like this: scatter plot

I am trying to plot a long list of coordinates however it appears to be making a seperate x and y axis label for every single point in an unordered manner. I just want to to have set x and y axis labels e.g. (10,20,...,100) instead of one appearing for every point.

def visualise(self):
    input_file = open("textFiles/points.txt", 'r')
    xVals = []
    yVals = []
    for line in input_file:
        line = line.split(",")
        xVals.append(line[0])
        yVals.append(line[1])

    plt.scatter(xVals,yVals, s = 2)
    plt.show()
SeanR
  • 1
  • You need to convert your values from string to numeric – JohanC Apr 27 '22 at 05:30
  • Does this answer your question? [reducing number of plot ticks](https://stackoverflow.com/questions/6682784/reducing-number-of-plot-ticks) or [this](https://stackoverflow.com/questions/12608788/changing-the-tick-frequency-on-x-or-y-axis-in-matplotlib) – My Work Apr 27 '22 at 06:40

0 Answers0