How to only print GUI graph with GUIDE toolbar

조회 수: 1 (최근 30일)
Kokalz
Kokalz 2012년 7월 24일
Hi guys!
I have added a toolbar for my GUI ( that has some data and a graph). I added save, print and data cursor tools to it. How can I do following:
  • When someone clicks the print button I want it to print only the graph and set the defaul layout to 'Landscape'.
  • Clicking the save button does nothing. How can I configure it to save the graph as a picture (if that's even possible).
  • Clicking the data cursor option allows me to get values from any location on my gui. I want it to give values only of the graph.
I tried looking at the properties in the GUIDE toolbar editor, but can't find anything like that there. I also tried to using a simple 'Print' pushbutton for printing with function 'print(handles.axes1)' in its callback, but it gives me the following error:
Error using LocalCheckHandles (line 87)
Handle Graphics handle must be a Figure.
Any help is really appreciated!

답변 (1개)

Kokalz
Kokalz 2012년 7월 24일
After doing a bit more searching it appears that you cannot just print from the axes. The only possible way to print is to copy the graph to a figure and print from there. When I do that, my printed graph is only partially on the paper. How to make i fit properly??
Thank you!
  댓글 수: 2
Jan
Jan 2012년 7월 24일
Set the PaperPosition and PaperSize of the figure accordingly.
Kokalz
Kokalz 2012년 7월 24일
Yeah, figured it out literally a second ago. Thanks a lot for help!
Do you think there's a chance to make the 'Data Cursor' tool from the GUIDE toolbar editor only functional on the graph?
Thank you!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by