使用“框架"而不是“轴"时不裁剪BarChart [英] Not cropping BarChart when using Frame instead of Axes

查看:89
本文介绍了使用“框架"而不是“轴"时不裁剪BarChart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚发现使用Frame而不是Axes可能会裁剪BarChart.

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

示例:

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?

编辑

每个请求的屏幕截图:

推荐答案

如何使用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}]


编辑

我开始认为这确实是一个错误.看看如果我们仅更改数据中元素的顺序会发生什么.它确认(但不显示其基线)先前高度忽略的零高度钢筋. 请注意,这次我不必使用PlotRange来调整显示.

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.

这篇关于使用“框架"而不是“轴"时不裁剪BarChart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆