Reputation: 103
I have the following code that builds the empirical function according to data stored in Z_score_list.
Z_score_list.sort()
edf = []
step = 1 / len(Z_score_list)
for i in range(len(Z_score_list)):
edf.append(step * i)
edf = np.array(edf)
fig, ax = plt.subplots()
ax.plot(Z_score_list, edf,
'b--', lw=3, alpha=0.6, label='Эмпирическая')
plt.show()
As a result I have this:
There isn't enough space for X axis. So it breaks the plot and continues it from the start of X axis to its end. How can I scale this graphic for the one continuous line that will be independent from Z_score_list size?
Upvotes: 0
Views: 183
Reputation: 103
The problem wasn't in plot
function itself, there were NaN values in Z_score_list
and every occurance of it starts sort
again from the index NaN was occured. Removing these values made it all ok.
Upvotes: 0