3

我已经安装了最新版本的 MATLAB R2014b,我遇到了 stem 函数没有显示数据点的行的问题,例如:

stem(1:12);

好像这个

我尝试调整 Linestyle,如文档中所示。

figure
X = linspace(0,2*pi,25)';
Y = (cos(2*X));
stem(X,Y,'LineStyle','-.',...
     'MarkerFaceColor','red',...
     'MarkerEdgeColor','green') 

但这没有帮助,知道这里有什么问题吗?

运行后更新

h= stem(1:12)
get(h) 

这是输出:

  Annotation: [1x1 matlab.graphics.eventdata.Annotation]
          BaseLine: [1x1 Baseline]
         BaseValue: 0
      BeingDeleted: 'off'
        BusyAction: 'queue'
     ButtonDownFcn: ''
          Children: []
          Clipping: 'on'
             Color: [0 0.4470 0.7410]
         CreateFcn: ''
         DeleteFcn: ''
       DisplayName: ''
  HandleVisibility: 'on'
           HitTest: 'on'
     Interruptible: 'on'
         LineStyle: '-'
         LineWidth: 0.5000
            Marker: 'o'
   MarkerEdgeColor: 'auto'
   MarkerFaceColor: 'none'
        MarkerSize: 6
            Parent: [1x1 Axes]
     PickableParts: 'visible'
          Selected: 'off'
SelectionHighlight: 'on'
      ShowBaseLine: 'on'
               Tag: ''
              Type: 'stem'
     UIContextMenu: []
          UserData: []
           Visible: 'on'
             XData: [1 2 3 4 5 6 7 8 9 10 11 12]
         XDataMode: 'auto'
       XDataSource: ''
             YData: [1 2 3 4 5 6 7 8 9 10 11 12]
       YDataSource: ''
             ZData: [1x0 double]
       ZDataSource: ''
4

0 回答 0