Not cropping BarChart when using Frame instead of Axes

余生长醉 提交于 2020-01-15 06:32:10

问题


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.



来源:https://stackoverflow.com/questions/6557883/not-cropping-barchart-when-using-frame-instead-of-axes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!