Borrar filtros
Borrar filtros

Line color in plotyy graph

39 visualizaciones (últimos 30 días)
Fotis
Fotis el 25 de Mayo de 2015
Comentada: Fotis el 25 de Mayo de 2015
Hi all,
I use this code to plot a yy graph.
ratio=((Power./1000)-1240)./(Power./1000);
plotyy(P.e_hp./100,Power./1000,P.e_hp./100,ratio,'plot','plot');
Power and P.e_hp are 1*53 vectors. I want to give color to the plotted lines but at the same time set the color of all axes black. Any ideas how to do it? I am looking it up without much help. Thanks in advance!

Respuestas (1)

Walter Roberson
Walter Roberson el 25 de Mayo de 2015
[hAx,hLine1,hLine2] = plotyy(P.e_hp./100,Power./1000,P.e_hp./100,ratio);
set(hLine1, 'Color', 'r');
set(hLine2, 'Color', 'b');
set(hAx, 'Color', 'k');
  2 comentarios
Walter Roberson
Walter Roberson el 25 de Mayo de 2015
Note: the Color property of axes is the backplane color. If you want to set the color of the box, set XColor and YColor. If you want to set the color of the tick labels, then leave the TickLabelInterpreter property set to its default 'tex' and modify the XTickLabel and YTickLabel properties so that each string is of the form '\color{NAME}TICKTEXT' or '\color[rgb]{R,G,B}TICKTEXT' such as '\color{magenta}1.5x10^{4}'
Fotis
Fotis el 25 de Mayo de 2015
Thanks!

Iniciar sesión para comentar.

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by