matplotlib - I cannot figure out how to spread out the space on the y axis for my scatterplot in Python -
i entered code x
, y
, , size
defined variables created earlier. problem points bunched , want stretch out y-axis.
plt.scatter(rets.mean(),rets.std(),s = area) plt.xlabel('expected return') plt.ylabel('risk')
for example, right y-axis goes -0.005
0.04
in increments of 0.005
, how adjust count in increments of 0.0025
?
import matplotlib.pyplot plt import matplotlib.ticker mticks fig, ax = plt.subplots() ax.set_ylim((-.005, .04)) ax.yaxis.set_major_locator(mticks.multiplelocator(.0025))
Comments
Post a Comment