Azzera filtri
Azzera filtri

Error while using plotyy function

1 visualizzazione (ultimi 30 giorni)
Poulomi Ganguli
Poulomi Ganguli il 16 Mag 2018
Modificato: the cyclist il 16 Mag 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 Commento
the cyclist
the cyclist il 16 Mag 2018
Can you upload a MAT file with the variables, so that we can try your code ourselves?

Accedi per commentare.

Risposta accettata

the cyclist
the cyclist il 16 Mag 2018
Modificato: the cyclist il 16 Mag 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.

Più risposte (0)

Categorie

Scopri di più su Two y-axis in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by