SIMULINK Scope ylabel

2 次查看(过去 30 天)
Benjamin
Benjamin 2012-2-9
Hi to all of you,
I am preparing a publication (in LaTeX) for which I need high quality .pdf/.eps figures of the simulink scope in just black and white with the help of 'export_fig' (thanks to Oliver Woodford)
I worked a little bit into figure handles (I am very new to that, normally my job is just SIMULINK) and wrote a little scipt which helps me threating the scope like a figure and makes it printible for puplication.
set(0,'ShowHiddenHandles','on') %switches the handles of the scope on
%now the scope can be treated like
%a figure
set(gcf,'menubar','figure') %switches the menubar on
h1=get(gcf);
h2=get(gca);
%properties of the figure
%set(gcf, 'Position', [500 500 500 500])%sets the position [left bottom width hight]
set(gcf,'Color',[1 1 1]) %sets the background to white
%line1=get(h2.Children(1))
%line1=get(lines.Children(1))
%set(line1,'LineStyle','--')
set(h2.Children(1),'Color',[0 0 0])
set(h2.Children(1),'LineWidth',3)
set(h2.Children(1),'LineStyle','--')
%properties of the axes
set(gca,'Color','none') %sets the axis bachground to white
set(gca,'XColor',[0 0 0]) %sets the x-axis and grid to black
set(gca,'YColor',[0 0 0]) %sets the y-axis and grid to black
set(gca,'Box','off') %removes the box around the axis
xlabel('time in seconds')
ylabel('Amplitude in meters')
%removes the text boxes
delete(h1.Children(9)) %deletes the textbox 'offset'
delete(h1.Children(10)) %deletes the textbox behind 'offset'
%
%print figure
export_fig test.pdf
The problem is that the ylabel does not appear. When I change the color of the according text it is the background is visible but the text isn't. What can I do to set this ylabel?
Thanks for your Benjamin

回答(1 个)

Guy Rouleau
Guy Rouleau 2012-2-9
I recommend another approach.
Since you need that for a publication, you do not need the Simulink Scope to look like that during the simulation.
Instead of hacking into the Simulink scope, save the data and use SIMPLOT to create a MATLAB figure.
See this post for an example:

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by