Mathematica 条形图顶部的网格线
是否可以通过 BartChart 获取 GridLine ? 网格线将其绘制在下方,而网格似乎不适用于条形图。
BarChart[{Range[10], Range[10]},
ChartLayout -> "Stacked",
GridLines -> {None, {4}},
GridLinesStyle -> Directive[Orange, Thick]]
Is it possible to get a GridLine over a BartChart ?
Gridlines draw it under and Mesh does not seem to work with BarChart.
BarChart[{Range[10], Range[10]},
ChartLayout -> "Stacked",
GridLines -> {None, {4}},
GridLinesStyle -> Directive[Orange, Thick]]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可以通过方法选项来完成:
(这应该适用于任何形象的。)
This can be done via a method option:
(this should work for any graphic.)
您的另一个选择是使用 Epilog 显式绘制网格线。如果您想要一些网格线(例如垂直网格线)在后面和一些在前面,这将是解决方案。
我添加了一些其他选项,以防您实际上不希望网格线在轴上溢出。
Your other option would be to draw the gridline explicitly with Epilog. This would be the solution if you wanted some gridlines (e.g. vertical ones) behind and some in front.
I have added some other options in case you don't actually want the gridline to bleed over the axes.