Error while using plotyy function

1 次查看(过去 30 天)
Hello: I am using plotyy function with indexing:
X = B_SLR(:,1); Y = B_SLR(:,2); Y1 = B_HighQ(:,4);
kdx = B_SLR(:,4) < 0.10; mdx = B_HighQ(:,4) < 0.10;
plotyy(X(kdx),Y(kdx),'bo-','lineWidth',2,'MarkerEdgeColor','b','MarkerFaceColor','b',X(kdx),Y1(mdx),'ro-','lineWidth',2,'MarkerEdgeColor','r','MarkerFaceColor','r'); hold on;
plotyy(X(kdx),Y(~kdx),'bo-','lineWidth',2,X(kdx),Y1(~mdx),'ro-'); hold on;
in which X,Y and Y1 are 10x4 matrices. I am imposing certain criteria for indexing, such as, if a particular value in column 4 in matrices Y and Y1 are less than 0.10 the markerfacecolor will be filled and if not then it will be unfilled with any color. However, while using plotyy function I am encountering foll. error:
plotyy error Argument must contain a character vector or function handle.
I am unaware of any other ways to plot secondary Y-axes other than plotyy. Any help in this regard?
  1 个评论
the cyclist
the cyclist 2018-5-16
Can you upload a MAT file with the variables, so that we can try your code ourselves?

请先登录,再进行评论。

采纳的回答

the cyclist
the cyclist 2018-5-16
编辑:the cyclist 2018-5-16
Read the documentation for plotyy a bit more carefully. The first four arguments are supposed to be vectors with data.
If you have version R2016a or later, the preferred way to do this is with yyaxis.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Two y-axis 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by