Children of axes after using yyaxis right
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jonas Schütz
el 19 de Jun. de 2023
Respondida: Adam Danz
el 19 de Jun. de 2023
Why does children not include a and how would I get a(only using ax, b or c)?
% Create the axes object
ax = axes();
% Plot 'a' and 'b' using the same axes
a = plot(ax, 1:10, 1:10, 'DisplayName', 'Test');
yyaxis right
b = plot(ax, 1:10, ones(10, 1), 'DisplayName', 'TestRight');
hold on
c = plot(ax, 1:10, 0.5*ones(10,1), 'DisplayName', 'TestRight2');
% Access the children of the parent object
children = ax.Children
0 comentarios
Respuesta aceptada
Adam Danz
el 19 de Jun. de 2023
% Create the axes object
ax = axes();
% Plot 'a' and 'b' using the same axes
a = plot(ax, 1:10, 1:10, 'DisplayName', 'Test');
yyaxis right
b = plot(ax, 1:10, ones(10, 1), 'DisplayName', 'TestRight');
hold on
c = plot(ax, 1:10, 0.5*ones(10,1), 'DisplayName', 'TestRight2');
% Access the children of the parent object
yyaxis left
children = ax.Children
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!