python - How can I stretch my pyplot to make markers more discernible? -
i'm new python, i'm sorry in advance if i'm missing obvious answer. first code, made graph compile data. however, 1 of data sets put close , hard discern between markers, need stretch out graph widen it. i've tried this:
fig.subplots_adjust(bottom = 0) fig.subplots_adjust(top = 1) fig.subplots_adjust(right = 1) fig.subplots_adjust(left = 0)
but doesn't expand enough , end this:
i've searched everywhere solution, including matplotlib documentation, can't find solution anywhere. know of answer? sorry again if i'm missing obvious,
thanks.
i not sure if kind of thing you're looking for, legend()
inside matplotlib.pyplot
may able out.
import matplotlib.pyplot plt p1 = plt.plot(data1) p2 = plt.plot(data2) plt.legend([p1, p2], ["data 1", "data 2"])
in general, once have adjusted axes data fills possible space, can't squishing except color different curves differently, , put legend.
you can try setting y-limits of plot using ylim
ymin, ymax = ylim() # return current ylim ylim( (ymin, ymax) ) # set ylim ymin, ymax ylim( ymin, ymax ) # set ylim ymin, ymax
Comments
Post a Comment