Duplicate a Catergorical Barchart on an axes component to a new figure - Xticklabels are messing up
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello.
I have a GUIDE Gui with several axes components on. One of these (Axes(handles.axes2) has a barchart on with a Catergorical X-axis.
I am trying to copy this to a new figure, but can't quite get th catergorical x-axis labels correct.
%Extract Everything from my main Guide GUI from the axes2 component
axes(handles.axes2)
hh1 = findobj(gca,'Type','bar')
hh2 = findobj(gca,'Type','text')
hh3 = findobj(gca,'Type','Legend')
tl=xticklabels(gca)
%Create a new figure
figure
%Copy to the figure (subplot)
hSub2 = subplot(1,2,2); grid on; grid minor;
if ~isempty(hh1)
copyobj(hh1,hSub2);
copyobj(hh2,hSub2);
copyobj(hh3,hSub2);
end
%Add the x-axis ticklabels
xticklabels(gca,tl)
drawnow;
But as you can see, Im not quite able to duplicate my original barchart on axes2 (left) to that on the new figure (right). Also the colors and legend appearance are not the same.
Does anyone have any advice please?
Thanks
Jason
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Modify Image Colors in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!