处理 Mathematica 图表中的刻度
请考虑:
dalist = {{379, 219, 228, 401}, {387, 239, 230, 393},
{403, 238, 217, 429}, {377, 233, 225, 432}}
BarChart[dalist,
Frame -> True,
FrameTicks -> {{None, None}, {None, None}}]
我无法弄清楚处理蜱虫本身和范围的方法(数字)。我想看到范围,但不想看到如下所示的刻度:
编辑:
后,似乎我又创造了新的问题。 总结一下,我想看到: TicksLabel 但不是 Ticks(已解决) FrameLabel 但不是 Frame。
下面就来说明一下这个问题。 FrameStyle 控制框架标签。 因此,将 opacity[0] 应用于 FrameStyle 来隐藏框架会隐藏框架标签。
BarChart[Range[10],
ChartStyle -> Black,
PlotRangePadding -> 0,
Frame -> {{True, False}, {True, False}},
FrameLabel -> {{"Why?", None}, {"Because !", None}},
FrameTicksStyle -> Opacity[1],
FrameStyle -> Opacity[0],
PlotLabel -> Style["Bonjour", Bold, 16, Opacity[1]],
LabelStyle -> Directive[Black, Bold, 12, Opacity[1]],
ImageSize -> 400]
Please consider :
dalist = {{379, 219, 228, 401}, {387, 239, 230, 393},
{403, 238, 217, 429}, {377, 233, 225, 432}}
BarChart[dalist,
Frame -> True,
FrameTicks -> {{None, None}, {None, None}}]
I can`t figure out the way to deal with the ticks themselves and the range (the numbers). I would like to see the Range but not the ticks like the below :
EDIT :
Having solved some problem, it seems I created new ones.
To Summarize, I would like to see :
TicksLabel but not the Ticks (solved)
FrameLabel but not the Frame.
The Below shall illustrate the problem. FrameStyle control the Frame Label.
So applying opacity[0] to FrameStyle to hide the frame hides the frame Label.
BarChart[Range[10],
ChartStyle -> Black,
PlotRangePadding -> 0,
Frame -> {{True, False}, {True, False}},
FrameLabel -> {{"Why?", None}, {"Because !", None}},
FrameTicksStyle -> Opacity[1],
FrameStyle -> Opacity[0],
PlotLabel -> Style["Bonjour", Bold, 16, Opacity[1]],
LabelStyle -> Directive[Black, Bold, 12, Opacity[1]],
ImageSize -> 400]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Ticks 和 FrameTicks 有可选的更复杂的语法,其中每个刻度可以指定为
{x,label,{length_inside,length_outside}}
因此,要获得不带刻度的刻度标签,请将第二对数字指定为两个零。
要复制示例中的刻度,您可以使用
对于条形图,条形图位于 1、2、3...x 位置,因此这需要是:
按照注释中的要求,如果您想要数字但没有刻度并且没有框架,添加:
编辑并在任何框架标签上使用
样式
。最终结果:
我对 这个问题可能帮助照亮。
Ticks and FrameTicks have optional more complex syntax, where each tick can be specified as
{x,label,{length_inside,length_outside}}
So to have ticks labels without ticks, specify the second pair of numbers as two zeros.
To replicate the ticks in your example, you would use
For BarCharts, the bars are at 1, 2, 3... x-positions, so this needs to be:
As requested in comments, if you want numbers but no ticks and no frame, add:
EDIT And use
Style
on any frame labels.End result:
My answer to this question might help illuminate.
也许您正在寻找
ChartLabels
:Perhaps you are looking for
ChartLabels
: