get xlabel,ylabel,title from premade plots
1 view (last 30 days)
I know I can get these values from regular plots I make, either with a plot handle or with get(get(gca,'property'),'String'), like this:
xlabel('x label that I wrote')
However, I can't seem to do that for "premade" plots, ones that MATLAB makes automatically. For example, it doesn't work for rlocus and lsim. I'll show that here:
While it's true that I can access it from the plotting window and change the labels manually, I hope there's a more efficient way to do it. (I'm trying to change the color of the labels.)
Any help would be super appreciated. Upvote for reading. You're all pros.
Voss on 13 May 2022
I don't think this will work for every premade plot, but it seems to work for plots created with rlocus
% apparently there are two axes, and the one you want has
% HandleVisibility set to 'off'.
% use findall to find it:
ax = findall(gcf(),'Type','axes')