How to only print GUI graph with GUIDE toolbar

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 个)

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 个评论

Set the PaperPosition and PaperSize of the figure accordingly.
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!

请先登录,再进行评论。

类别

提问:

2012-7-24

Community Treasure Hunt

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

Start Hunting!

Translated by