How to I give a title and axes names to the graph generated by the XY Graph Block In Simulink

582 views (last 30 days)
I am using Simulink for a certain co-simulation as a part of my project. The results to my work can be best explained through a bunch of XY Graphs generated in Simulink. The only downside is I am unable to change the axes names and the graph title as seen in the Graph Window. Is there a way to do this? It would greatly help me compile my results faster.
If it is not possible, kindly give me other alternatives if any.
Thanks in advance.
Regards, Avinash

Accepted Answer

TAB
TAB on 10 Sep 2012
Edited: TAB on 12 Sep 2012
Unfortunately there is no option to automatically set the axes labels or name in figure generated by simulink X-Y graph.
However, after simulation, you can manually add axes names from figure GUI or from command window.
From Figure GUI
  • Select the X-Y graph generated by simulink. Run below cammands in command window
set(0,'ShowHiddenHandles','on')
set(gcf,'menubar','figure')
  • These commands will enable the toolbar in X-Y graph figure window. You can add axes names from Insert >> X Label and Insert >> Y Label.
From command window
After the simulation, select X-Y plot window and run these command in command window
xlabel('X_Axis_Name')
ylabel('Y_Axis_Name')
set(gcf,'name','Figure Name')

More Answers (3)

Dominik Grochowski
Dominik Grochowski on 2 Apr 2022
right-click on the figure
select "Print Display to Figure"
In the new window:
Go to Insert
there you can add/remove labels such as xlabel and ylabel

Muhammad Hamza Tariq
Muhammad Hamza Tariq on 18 May 2018
Adding a title to Simulink' scope window:
- Open the scope window
- Right click on the figure and go to " Axes Properties "
- Mention your desired title in the textbox, below the Y-max, Y-min setting blocks.
- Re-run the simulation

usdb usdb1
usdb usdb1 on 13 Sep 2013
when the name has grec character,it not appear in the graph

Categories

Find more on Graphics Object Identification in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!