划分图形并处理 Xticks (Matlab)
我在 Matlab 中的数字方面遇到一些问题。由于我总共有 171 个条形图,因此我将条形图分成了两个数字。我首先取了前半部分的数据(图1),然后取了后半部分的数据(图2)。但后来我遇到了 Xticks 的问题。现在两者都从零开始,但我希望后半部分(图 2)从 86 到 171(或者以 10 为间隔,以便它们从 80 到 180,例如)。我尝试 set(gca, 'XLim', [86 171] 到第二个数字,但发生的情况是该图中的条形最终超出了该数字,这是我之前没有想到的......任何有关如何解决该问题的提示Xticks/划分图形的问题?
我还有关于 Xticks 的另一个问题!我想将它们在图中向下移动,因为我在每个条形的正上方添加了文本(或实际上对应于不同条形的其他数字)。使数字为通过“set(gcf, 'Position', get(0,'Screensize'));”来适应整个屏幕,但 Xticks 应该向下移动,以便 Xticks 和其他数字不会彼此重叠。学习如何解决这些问题,但似乎我需要有更多经验的人的帮助!
I have some problems with figures in Matlab. I divided my bar plot into two figures since I have totally 171 bars. I took the first half of the data at first (figure 1) and then the second half (figure 2). But then I got a problem with Xticks. Now both start from zero, but I would want the second half (figure 2) to be from 86 to 171 (or with intervals of 10 so that they are from 80 to 180, for instance). I tried set(gca, ‘XLim’, [86 171] to the second figure, but what happened was that bars in that figure ended up outside the figure, which I hadn’t thought before... Any hints how to solve the problem with the Xticks/dividing the figure?
I also have another question about Xticks! I would want to move them downwards in the figure, since I have added text (or actually other numbers which correspond to different bars) right above every bar. I made the figures to fit the whole screen by “set(gcf, 'Position', get(0,'Screensize'));”, but Xticks should be moved downwards so that Xticks and and other numbers are not on top of each other. I would like to learn how to solve these problems, but it seems like I need help from someone who has more experience!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
x 刻度由
bar()
的X
参数指定。The x ticks are specified by the
X
argument tobar()
.