How can I change LineWidth of all lines in a printed figure from Simulink?
57 views (last 30 days)
Show older comments
Hello, since the simplot-command isn't working in Matlab 2015 anymore, i tried to manually manipulate a plotted figure of a scope window after the simulation plotted it.
I am trying to find all lines and change the LineWidth and Color, see the attached m-file Image_Maxon_REmax29_ClosedLoop_2015.m
Also I am trying to adjust the inner border space of the image, so that the main title and axis titles can be read. Please see the attached image-file actual. My goal is to have an image like desired.
Can you help me please, to give me some tips?
Thanks in advance and with nice greetings, Lars
0 Comments
Answers (1)
Sebastian Castro
on 22 May 2015
The documentation refers to simplot as being replaced with Simulink.sdi.view, which brings up the new Simulation Data Inspector which came out in R2014b:
Is this something you can use? If not, do you have a way of saving the figure as a MATLAB .fig file? Because that would be another way to make this much easier than an image processing problem.
- Sebastian
2 Comments
Sebastian Castro
on 22 May 2015
Well, if you had a .fig file it would be ideal because MATLAB figures are easy to modify programmatically... scopes, not so much.
For instance, if you have a figure file, you can just do the following... although I see that you do this in your attached script anyway.
open('untitled.fig')
lines = findobj(gcf,'Type','Line');
for i = 1:numel(lines)
lines(i).LineWidth = 2.0;
end
One thing you can do with scopes in R2015a is to select the "Try Time Scope" button, which is the last button in the Scope's toolbar. If you do that, you see that it will change the type of scope. Once you do that, there is a "File > Print to Figure" option which will get you a figure out of the plot.
Once you have this figure, you can then run the above code on it.
How's this all sound?
- Sebastian
See Also
Categories
Find more on View and Analyze Simulation Results in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!