ConstantLine not showing up in plotbrowser
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
When drawing a ConstantLine with xline or yline, it doesn't show up in the plotbrowser.
Ex :
xline(5, 'DisplayName', 'test'); plotbrowser;
How to solve this ?
2 comentarios
Walter Roberson
el 12 de Feb. de 2024
If you happen to be drawing into a uiaxes then the handlevisibility of the axes might be set to off so findobj() might not notice the handle. Try findall('tag', 'xlinetag')
Respuestas (1)
Shaik
el 11 de Mayo de 2023
Editada: Shaik
el 11 de Mayo de 2023
Hi Pierre,
By default, ConstantLines drawn with xline or yline may not show up in the Plot Browser when using MATLAB R2019b or earlier versions. This is a known issue with these versions of MATLAB, but it has been fixed in MATLAB R2020a and later versions.
To work around the issue in MATLAB R2019b or earlier versions, you can manually add a legend entry for the ConstantLine using the legend function. Here's an example:
Hope it helps.
x = 1:10;
y = x.^2;
figure;
plot(x, y);
hold on;
h = xline(5, 'DisplayName', 'test');
legend(h, 'Location', 'south');
1 comentario
Ver también
Categorías
Más información sobre Interactive Control and Callbacks 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!