We had to design two sepereate GUIs: one for ppspy and one for ppmesh and ppsurf. At first we tried to get close to the the typical Matlab look with the little icons and the pretty layout. However, using Matlab's guide the possibilities turned out to be limited. Icons were not available, mouse interactions such as drag-and drop, which we could have used for rotations, also turned out to be not an option. Even simply clicking on an axes-figure required some more dirty hacking in the callback functions.
Realizing this, we decided to move away from the regular Matlab design. Still using guide we designed two GUIs we thought are closer to the users need.
The interesting part, which also took a long time to figure out and implement in Matlab, is the navigation panel. We decided it would be very useful for a user looking at a bog matrix to know which part of the matrix he/she is looking at. So the navigational panel was created. When starting the matrix is randered for the first time. We then take a snapshot which will remains available. This snapshot at a lower resolution is displayed on the left. When in a zoomed in state a red box on the naviagtional panel shows the user in which area of the matrix the user is looking at right now. Further, this rectangle and therefore the view on the matrix can be moved by clicking anywhere on the navigation panel. The point of the click will then be the center of the new center of the rectangle.
We kept the menus to the bare minimum so they would fulfill the basic needs. We included a print option allowing the user to print the current visible image to their printer and a export option for the user to save the current image as any Matlab supported graphic file (JPEG, TIFF, etc). A minor bug of the pring option is that you cannot specify a certain set of axes to be printed. Instead it prints all the axes on the figure. So when printing not only will the main axes be visible, but usually also the navigation panel and for some odd Matlab reason also the listbox.
This GUI is similar to the ppspy GUI, but adjusted to the needs of ppmesh and ppsurf. It consists of the following elements:
'Zoom in' and 'Zoom out' do the usual business. However, in this GUI 'Reset' not only resets the zoomfactor, but also the rotational angles. These angles can be entered manually in the corresponding text boxes, where phi is a rotation in the plane of the image ('left' and 'right') and theta corresponds to a vertical rotation ('up' and 'down'). Since it was not possible to implement the usual mesh rotation using mouse drag-and-drop we added again a small navigational panel. This time the navigational panel is simply white. The axes correspond to the two different angles and run from -180 to +180 degrees. A red circle indicated the current setting. When then clicking on the panel the image will be rotated. The menu then does the same as the ppspy menu: it lets the user print and export the currently visible rendered matrix.
Note neither GUI will run for matrices smaller than 1024x1024. It is usually faster for smaller matrices to be rendered by matlab spy. In this case i.e. ppspy displays the matrix using regular spy.