Cannot move or resize colorbar in tiledlayout
Ältere Kommentare anzeigen
Hi everyone. I have a problem with the Colorbar and the tiledlayout function. Once I create a tiledlayout and create the colorbar for each axes it appears that i cannot manually move or resize the colorbar. The following warning appears:
Warning: Error updating ColorBar.
The reference object is invalid.
And then the colorbar places in the middle of the axes.
As an example, try out this:
tiledlayout(1,2);
ah(1)=nexttile(1); imagesc(rand(3,4));
ah(2)=nexttile(2); imagesc(rand(3,4));
cbh = colorobar(ah(2));
cbh.Position(4) = 0.5
5 Kommentare
Sindar
am 20 Jan. 2020
1) you have a typo in your example code (but not your actual) "colorobar" vs "colorbar"
2) it seems like it works despite giving a warning
Edoardo Ferocino
am 20 Jan. 2020
Sindar
am 20 Jan. 2020
Ah, you're right. It moves the colorbar, but not how you want, and it doesn't update the position
Sindar
am 20 Jan. 2020
The exact same behavior happens when you try to move/resize it in the GUI. That's a bad sign
jerry Lu
am 5 Dez. 2023
did u solved that,i met same question like u
Antworten (1)
Edoardo Ferocino
am 20 Jan. 2020
0 Stimmen
1 Kommentar
Sindar
am 20 Jan. 2020
Hopefully they'll improve it in later versions. I was also about to switch to TiledChartLayout. Thanks, now I know to wait until it's more a more complete option.
Kategorien
Mehr zu Annotations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!