如何使用GNU Octave中的范围在X轴或y轴上设置tic? [英] How to set tics in x or y axis using range in GNU Octave?
本文介绍了如何使用GNU Octave中的范围在X轴或y轴上设置tic?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
x的长度= 1000, y的长度= 1000
length of x = 1000, length of y = 1000
plot(x, y, '+');
xlabel ("p");
ylabel ("Q(p)");
title('Custom plot');
set(gca, 'xtick', [0.00000 0.20000 0.40000 0.60000 0.80000 1.00000])
此 set 命令在X轴上创建6个标记,但我想创建20个刻度,以便在2个标记之间有50个元素.
This set command creates 6 tics in X axis, but I like to create 20 ticks so that there are 50 elements in between 2 tics.
提前谢谢.
推荐答案
根据您的评论,我想您不知道Octaves范围"背后的概念. 请参见此处
From your comment I guess you don't know the concept behind Octaves "range". see here
在您的情况下,如果您希望xticks从0到1000,而步骤之间的差是20,则只需使用:
In your case if you want the xticks go from 0 to 1000 and the difference between the steps is 20 just use:
set(gca, 'xtick', 0:20:1000);
这篇关于如何使用GNU Octave中的范围在X轴或y轴上设置tic?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文