Function graphics in a widget window [message #90816] |
Mon, 20 April 2015 07:54 |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
The IDL documentation gives an example of plotting to a widget window using function graphics
http://exelisvis.com/docs/WIDGET_WINDOW.html
and Paul van Delst gave a useful post on the subject http://tinyurl.com/qzxq7t4
It all works well but the display lacks the buttons which normally appear when running plot() from the command line. For example, in the widget window one can still right click to zoom in the plot, but there is no way to unzoom (that I know of) since the reset button is missing. Similarly, there is no button to write the plot to a disk format.
I can write widget buttons to do the same tasks (like I would have to do with direct graphics), but I wanted to make sure that there was no way to make the standard plot() buttons appear.
And one question about writing the reset zoom button. There is no reset method for plot(), so the way I do this is to
1. Store the values of the XRANGE and YRANGE properties when creating the plot
2. Restore these values to the XRANGE and YRANGE properties when the reset button is set.
It works but it feels very old-fashioned ;-), like I was still using direct graphics. Wayne
|
|
|