Inside the MATLAB Desktop
October 22nd, 2007
Tiling without a Wet Saw
The various desktop tools that contain documents (the Editor, Array Editor, Figures container, etc) display one document at a time by default. Tiling allows you to see more than one document at a time. For example, in the Editor you might want to see two files side-by-side as shown below.

To achieve this, choose “Left/Right Tile” from the Window menu or the Editor toolbar. Alternatively, you can choose “Top/Bottom Tile” to view one file above another. If you have more than two files open, the tiles will be populated with the file that was showing, plus the one that appears after it on the document bar. Once you have create the tiles, you can make any file appear in a particular tile simply by dragging from its document bar button into the tile. Alternatively, you can use the Tile dialog, displayed by choosing Window->Tile… from the menu bar, to select which files should appear in advance.
You can tile documents into an arbitrary n x m grid by using the tiling widget depicted below.

It’s not clear why you would want to display more than two text files at a time but if you do, have at it. On the other hand, it’s easy to envision situations where you would like to see more than two MATLAB figures at once. The following shows the result of selecting a 2 x 2 grid when there are three figures open.

When you specify a new grid, the open figures are dealt into the tiles by row and then column according to their order of appearance on the document bar, starting with the currently selected document. In the above case there was one less figure than the number of tiles so the last tile remained empty. You can tailor the tiling for three documents by removing the divider in the bottom half of the grid. To do this, hover of the small dot at the center of the divider. An [x] button appears. Click the [x] and the bottom tiles will merge into one.

Removing a divider never closes a document. For example, if you remove the divider between the two figures in the upper half of the Figures container depicted above, both figures remain open, one on top of the other. You can also subdivide any tile by right clicking on the title bar of the document it contains (or on the background if it doesn’t contain a document). The right click context menu offers options to subdivide the tile left/right or top/bottom.
You can carry this subdividing and merging business well beyond the point of utility. Witness the following tile arrangement:

You can even turn it into a bit of a game; How many subdivisions and merges do you need to arrive at this arrangement?

Clearly this post has now gone beyond the limit of utility.
By
Peter Muellers
Peter Muellers is a developer on the MATLAB desktop team. He works primarily on the desktop framework. Many of his better ideas occur while he is running, biking or sleeping.
12:06 pm |
Posted in Editor |
Permalink |
You can follow any responses to this entry through the RSS 2.0 feed.
You can skip to the end and leave a response. Pinging is currently not allowed.
Leave a Reply
|
I know it’s an old post but I have questions about the Figures container and the forums are mostly silent on this feature.
I had a neat and plesent work flow for interactive plotting with R2006a. I think the introduction of the Figures container is what messed it up. Used to be, when I pressed the show plot tools button, the figure would be surrounded by all the lovely tools, WITHOUT changing the figure window size and position. Now it’s the “show plot tools and dock figure” button, only the property editor shows up when I press it, and the figure size is fouled up. I have to go to the View menu to bring up the figure palette and the plot browser, and they further mess with my figure size. In fact they squeeze it into uselessness. I resize the figure so I can work with it, and when I hide the plot tools the figure expands to uselessness! I think this is related to the new “…and dock figure” part, but I’m not sure. Is there anyway I can recreate the older neater way? Is there a way to “show plot tools” but NOT “dock figure”, as an experiment? My work flow also includes a mixture of interactive and command line usage which is now greatly hampered, because docked figures cannot be resized by set command.
Big thanks for any tips, as well as to any person who read this too long question regardless of answer,
-naor
Noar,
You can achieve something similar to the old behavior as follows:
Granted this is a fair number of steps but the position and size of the Figures container and the plot tools will be remembered across sessions, so you should only have to do the first five steps once.
Thanks Peter!
This went a long way toward fixing my desktop experience. My bet that the author of the post would have a feed to the comments months later paid off :)
I am trying to learn more about this container object but I’m having trouble locating it in the documentation. For example, how can I get/set the container size so that if someone were, say, a perfection freak they could make the container the right size for a single maximized figure in it would be x pixels wide by y high?
Thanks again,
-naor
The figures container and plot tools are designed to be interactive tools. As such they do not provide programmatic APIs that offer the level of precise control you are looking for. The basics of figures container interactive use are covered in the help documentation at http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f5-41409.html