Plotting on .fig file (in new window if possible)
Afficher commentaires plus anciens
Hello,
I am trying to open a figure and plot additional data on it. The figure was given to me as a .fig file so I do not have the data to recreate it.
To open the file, I am using the following code:
fig = openfig('filename');
However that opens it in the script tab and not as a new figure window. How can I open it in a new figure window like all my other plots?
Once I have that opened (regardless of in new window or not), how do I plot on it?
I am trying
openfig('filename')
hold on
plot(x,y)
But that doesn't seem to be working.
Any help is greatly appreciated.
Thanks!
4 commentaires
Turlough Hughes
le 9 Oct 2019
Can you upload the .fig file?
JD
le 10 Oct 2019
Stephan
le 10 Oct 2019
Upload the file means to attach the .fig file i guess- not a picture of it.
JD
le 10 Oct 2019
Réponse acceptée
Plus de réponses (1)
Ankit
le 9 Oct 2019
Here is an example:
close all;
MySavedPlot = open('MySavedPlot.fig');
figure(MySavedPlot)
hold on
x = linspace(-2*pi,2*pi);
y1 = cos(x);
plot(x,y1,'color','b')
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

