How to set tics in x or y axis using range in GNU Octave?

一个人想着一个人 提交于 2020-01-05 07:08:14

问题


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])

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.

Thanks in advance.


回答1:


From your comment I guess you don't know the concept behind Octaves "range". see here

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);


来源:https://stackoverflow.com/questions/52675459/how-to-set-tics-in-x-or-y-axis-using-range-in-gnu-octave

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!