Scatter polar plot in matlab

≯℡__Kan透↙ 提交于 2020-01-13 19:22:09

问题


I'm trying to do a wedge plot (right ascension vs redshift). I was thinking I could use a scatter plot in polar coordinates. The polar function in matlab seems very limited. Even this

polar(a(:,1),a(:,2),'Linewidth',1)

gives me an error:

Error using polar (line 23)
Too many input arguments.

Is there a simple way to achieve what I want using Matlab? Do you know of another software that would do it easily?

Thanks,

Mike


回答1:


Matlab is quite adequate for that, I think.

As for the polar function, it seems it doesn't allow properties (such as 'linewidth') to be specified directly. But you can get a handle to the created object and then set its 'linewidth', or other properties:

h = polar(a(:,1),a(:,2));
set(h,'linewidth',1)

If you want a scatter plot, maybe you'd prefer not to have lines, but instead to plot a marker (such as a dot) at each point:

h = polar(a(:,1),a(:,2),'.');
set(h,'markersize',12)

Example:

To see a list of properties that you can set, as well as their current values, type

get(h)


来源:https://stackoverflow.com/questions/20317481/scatter-polar-plot-in-matlab

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