How can I give a figure both a name and a number?
75 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Felix Crazzolara
el 26 de Abr. de 2020
In my program I have a lot of windows and when working on it then I redraw the plots. Also I switch a lot between scripts which generate plots. What I would like to have is that say a specific script always uses a figure associated with a specifc number. In addition to that I want to figure to have title similarly as when we use figure('Name','Name of the figure'). How can I do that?
My MATLAB version is R2019b.
0 comentarios
Respuesta aceptada
Sriram Tadavarty
el 26 de Abr. de 2020
4 comentarios
Walter Roberson
el 26 de Abr. de 2020
fig_handle = figure('Name','Hello')
fig_num = fig_handle.Number
However, in some cases figures are generated that do not have an integer figure number, and when that happens, the Number property is usually empty. You can find the actual figure number in such cases by using
fig_num = double(fig_handle)
These days it is advised that you do not use figure numbers: just record the handles returned by figure() and pass those around.
Ver también
Categorías
Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!