Plotting Y-Axis on X-Axis as percentage?
Show older comments
Hi I am trying to read data the y-axis data from a txt file and separate the points in percentages as 5% percent each...5, 10, 15... for each separation [y-axis] and check the distance between each point.
However I am unable to do so as I get that the X and Y axis are different lengths
For the X-axis I try to use percentFormatter(xmax=20) but it gives me 1 as length
For the Y-axis I read data from a text file and set it as numpy array, sort it by ascending and it gives 200 length
Would be great to know also how to do so using a scatter graph
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
data = np.loadtxt("nb_with.txt", delimiter="\n", unpack=True)
y = np.array(data)
y.sort()
plt.plot(y, 'r+')
plt.show()
Answers (0)
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!