Python – Pandas’ stature was cut off when saving

Pandas’ stature was cut off when saving… here is a solution to the problem.

Pandas’ stature was cut off when saving

< partition >

DataFrame data, where date is an index, as shown below

date        count   
2017-03-20  119
2017-03-29  100
2017-04-03  118
2017-04-10  113

The format date is datetime64[ns].

When I try to

draw it with

p = data.plot(kind="bar"),

It adds hours:minutes:seconds to the axis value (to date). So, when I use

Save it

fig = p.get_figure()
fig.savefig('figure.jpeg'),

The frame cuts off the sun, month, and year, leaving only zeros in minutes and seconds….

Related Problems and Solutions