I get an extra set of incorrect axes when viewing a stackedplot figure in the LiveScript output.
I added variable names so that the correct set of axes are moved and you can see the two sets.
tbl=timetable([0;1],[1;1],[0;0],[1;0],'SampleRate',0.5);
tbl.Properties.VariableNames={'A somewhat longer name','shorter','short','shortest'};
stackedplot(tbl)
Results in the ouput of the LiveScript:
Results from using the command window:
Is this a bug or do I have some setting or option improperly set?

1 commentaire

Adam Kingsley
Adam Kingsley le 26 Oct 2020
This occurs even if I declare a vector/matrix instead of a timetable.

Connectez-vous pour commenter.

 Réponse acceptée

When I run your code in my computer, the resulting figure looks the same in a live script and the command window. I can also run it here using 20b.
tbl=timetable([0;1],[1;1],[0;0],[1;0],'SampleRate',0.5);
tbl.Properties.VariableNames={'A somewhat longer name','shorter','short','shortest'};
stackedplot(tbl)

5 commentaires

Adam Kingsley
Adam Kingsley le 26 Oct 2020
Thank you for checking. I'll continue looking.
Cris LaPierre
Cris LaPierre le 26 Oct 2020
Try restarting MATLAB?
Adam Kingsley
Adam Kingsley le 26 Oct 2020
It went away when I inserted "figure" before the stackedplot. And it stayed away when I removed "figure". Not sure why this happened but it appears to be associated with my code.
Adam Kingsley
Adam Kingsley le 26 Oct 2020
Yeah, I should have restarted Matlab before posting the question. That would have worked too, I'm sure. Thank you again.
Cris LaPierre
Cris LaPierre le 26 Oct 2020
It might depend what else you have in your live script. If you had another figure before, it will reuse the same axes, which could cause the problem. Using the figure command forces it to create a brand new figure for the plot, preventing any carry-over issues that might result from reusing an existing figure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Produits

Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by