How do I display a figure from another section again?
7 views (last 30 days)
Mareike Fischer on 17 Nov 2021
I gernerated a figure in an early section. In the next sections I calculate some values and store those in a table.
In the last section want to display the figure and the table in the output of my live script. But I don't know how to call up again the figure. Gcf only shows the properties.
My acutal goal is to publish that last section as a pdf to have a report of my results (figure & table)
Thanks in advance
Alamanda Ponappa Poovaya on 24 Nov 2021
Essentailly, you want to display a figure which you had previously created in a different section again. You can use the savefig and openfig functions to do so. Refer to the code snippet below
x = linspace(0,10);
y = sin(x);
xlabel('x ranges from 0 to 10')
ylabel('y = sin(x)')
Ensure you don't forget the semicolon after openfig because it would otherwise show the figure properties;
Refer to the documetation below