Hang up when saving figure as bmp using print.
Mostrar comentarios más antiguos
Hey everyone,
I have a data parser that creates several figures with multiple subplots. In order to keep from interupting the user while the parser is running, I have the figures' 'visible' set to 'off'.
I also use print() to save these figures as a bmp instead of saveas() because saveas() causes a window to briefly pop up while the code is running.
I made a very short and simple script to test my code which works but inside my parser MatLab hangs up as soon as it hits the print() command. It stays 'busy' next to the Start button.
Below is an example of my code (R2011b):
figure('visible','off'); %turn off visibility to prevent figure pop-up
h=figure;
i=1;
while i:4 %make the figure
A=rand(10,1);
B=rand(10,1);
subplot(2,2,i);
scatter(A,B);
i=i+1;
end
print(gcf,'-dbmp','randplot_test'); %save the figure
set(gcf,'visible','on'); %shows the figure to verify that the plots worked
This code shows that I'm using the print() command correctly so I'm not sure what's going wrong. Does anybody know how to fix this or at the very least know another way to save the figure while preventing windows from popping up?
Thanks, Eric
1 comentario
g. a.
el 8 de En. de 2017
Hello, I have a similar problem (https://ubuntuforums.org/showthread.php?t=2348871) but your code does not hangs up my matlab.
best g.
Respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!