matplotlib, object api in use to plot, plot type step
Low cardinality of y-axis variable. Two ticks that level too close to each other – their labels are visually joined. Attaching the screenshot presenting current look doesn’t work. yaxis has 6 ticks over all for whole plot.
y-axis variable values is major information the plot communicates, along with timing (x-axis)
How to get labels of two ticks 137, 145 more distant from each another? Remaining ticks are placed at values 9, 41, 73, 201. yaxis is linear.
import sys, pandas
import matplotlib.pyplot as plt
reghist = pandas.Series( [ int(elem) for elem in sys.stdin.read().split() ] )
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.step(reghist.index.to_numpy(), reghist.values)
ax.set_xticks([])
ax.set_yticks(reghist.unique())
ax.arrow(0,0,reghist.size,0,head_width=10, head_length=10)
ax.tick_params(labelsize='xx-large', direction='in')
fig.savefig("lampsgetswitched.png")
fig.savefig("lampsgetswitched.svg")
plt.show()
Lilkp2 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.