Not cropping BarChart when using Frame instead of

2019-07-20 22:20发布

问题:

I just found out that a BarChart may get cropped when using Frame rather than Axes.

Example:

data = {.2, .4, .6, 0., 0., 0.}
BarChart[data]
BarChart[data, Frame -> True, Axes -> False]

Is this a feature or a bug? If it is a feature, is there an easy way to prevent cropping?

EDIT

Screenshot, per request:

回答1:

Well, It was not always like that:



回答2:

How about using PlotRange?...

data = {.2, .4, .6, 0., 0., 0.}
BarChart[data]
BarChart[data, Frame -> True, Axes -> False, 
PlotRange -> {{.5, 6.5}, {0, .7}}, 
FrameTicks -> {None, Automatic, None, None}]


Edit

I'm beginning to think it is indeed a bug. Look what happens if we simply change the order of the elements in data. It acknowledges (but does not display the baseline of) the bars of zero height that it previously ignored. Notice that I didn't have to tweak the display using PlotRange this time around.