calplot
calplot copied to clipboard
Image left shifted
Hi, Using your examples I've found that if you specify more than one year and a colorbar the output image is shifted to the left so that only half of the large year legend is visible.
all_days = pd.date_range('1/1/2019', periods=500, freq='D')
days = np.random.choice(all_days, 500)
events = pd.Series(np.random.randn(len(days)), index=days)
fig, axes = calplot.calplot(events, colorbar=True, cmap='YlGn')
fig.savefig('test.png')
It seems to be proportional to number of years visualized.
@KirbyJames removing plt.tight_layout()
solves the issue for me
Thanks @xmichaelx - it gives plenty of white space ;-)
I worked around this with fig.savefig("test.png", bbox_inches="tight")
.
@carsonyl Briliant - this works for me both under Windows 10 and Raspbian. Many Thanks
plt.tight_layout()
can be turned off by passing tight_layout=False
to calplot.calplot()
in new calplot release 0.1.7.
calplot.calplot(events, tight_layout=False)
This issue is not present on my macOS set-up. Will investigate later.