Is it possible to change markers in Matlab plot function? [duplicate]

懵懂的女人 提交于 2019-12-01 14:44:59
Abhinav

Short answer : If you want custom markers, its convenient to make the plot in some other plotting software, like tikz.

Long answer :

  1. If you want a simple text marker, e.g. the letter 'A', then its possible as follows (source)

    font = 'Lucida Sans Typewriter';  % choose a font
    
    m = 'A';  % choose desired character
    
    x = 0:.5:2*pi;    
    
    y = sin(x);    
    
    % Use TEXT to plot the character along the data    
    
    text(x,y,m,'fontname',font,'color','red')    
    
    % Manually set axis limits, since TEXT does not do this for you    
    
    xlim([min(x) max(x)])    
    
    ylim([min(y) max(y)])
    
  2. If you want a more complicated marker, then I found an example here on stackoverflow.

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