Filter löschen
Filter löschen

Error while using plotyy function

1 Ansicht (letzte 30 Tage)
Poulomi Ganguli
Poulomi Ganguli am 16 Mai 2018
Bearbeitet: the cyclist am 16 Mai 2018
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 Kommentar
the cyclist
the cyclist am 16 Mai 2018
Can you upload a MAT file with the variables, so that we can try your code ourselves?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

the cyclist
the cyclist am 16 Mai 2018
Bearbeitet: the cyclist am 16 Mai 2018
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.

Weitere Antworten (0)

Kategorien

Mehr zu Two y-axis finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by