Using "print" with no desktop?
3 次查看(过去 30 天)
显示 更早的评论
I've got code that runs every hour and updates a graph. Using the print function, it creates a graph and saves it as a .jpg. However, the resolution is very low. When I run the code manually, it creates and saves the .jpg exactly as I want it. But when I am logged out (and the desktop is not available to MATLAB), the image created is poor quality. Here's my code for saving the plot:
print -djpeg birdmet.jpg -r100
drawnow
set(gcf, 'Color', 'white'); % white bckgr
I also have a .csh script to run my code, maybe it's the cause of the problem?:
#! /bin/csh
matlab -nodesktop -r "run /home/mmateling/realtime/capebird.m"
Any help would be greatly appreciated!
2 个评论
Oliver Woodford
2014-1-17
You haven't provided code that we can just run. However, I created a script called test.m containing
plot(rand(3));
drawnow;
print('test.jpg', '-djpeg');
and called
matlab -nodesktop -r "test"
and it worked fine, producing a sensible looking jpeg. That was on a Windows PC. What does your code run on?
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!