MATLAB Plot Tools

Summary

The MATLAB plot tools are a set of easy-to-use graphical tools for creating and modifying plots in a complex technical computing environment. They consist of three major visual components -- a palette, a plot browser, and an editor -- that work cleanly with preexisting plotting functionality.

Design Context

MATLAB's interactive plotting capabilities have always been powerful and flexible, but for years, users could only access them through a command-line interface. We knew this was unacceptable for new users and for those who were not comfortable with programming. A friendlier solution was needed.

However, most of MATLAB's users are not novices. Most already know and understand the command line, and they have a preexisting mental model about plotting, formed from their knowledge of MATLAB's programming functions and objects. We could not alienate these users, nor did we want to give them a useless tool. But they weren't entirely happy with the status quo, either. Usability tests and other research showed that plot creation took users far longer than necessary, and many long-time users simply didn't know about useful functionality!

So my challenge was threefold:

Solution

I chose an open-ended, three-component approach that allows the user to "drive" the process of plot creation himself, rather than restricting workflow via a wizard. The figure palette affords point-and-click creation of plots, but if the user wishes, he can skip that and create plots via a script or command. The plot browser looks and behaves like a legend, with the addition of live selection and the hiding and showing of plot elements; it too can be hidden. The property editor permits rapid, visually-driven editing of selected plot elements.

By making certain items available on the palette, I made some aspects of plot creation more discoverable than they had been before. But in usability tests, we've seen an even bigger gain in discoverability from the property editor. The carefully-designed controls there communicate what can be changed, and how, better than earlier editors have done.

Most importantly, the figure window containing the plots is always "live" at center stage. All actions performed by the tools have immediate, visible effects on it, and conversely, anything the user does on the command line immediately updates the plot tools. All GUI elements correspond to well-documented objects, functions, and properties -- thus, users who already have a mental model about MATLAB plotting will find this GUI to be familiar, and newcomers can use the GUI to learn those things, if they wish. In short, I took the figure as a "fixed point" and designed everything to support it.

Interaction Details

Workflow: The paths the user takes through these tools are very freeform and unrestricted. All three can be used, or only one or two. The user can even work in the command line, and interleave that form of interaction with GUI work. Entrances to additional non-modal tools are provided in strategic places.

A very few dialogs are modal -- one is a plot constructor, and another is an axes tick-label editor. These are complex, focused tools that ask the user to pay attention long enough to complete the task at hand, but they are rare enough that the overall impression of immediacy is retained.

Overall layout: Though the workflow is freeform, I wanted to provide a little guidance to new users. For creating new plots, the palette is placed on the left, where users are likely to look first. The plot browser is placed on the right, near the spot where legends are traditionally placed. The property editor, which is driven by mouse selection on the figure and requires a wide space, was placed at the bottom of the figure.

The plot tools are shown in fixed locations here, but recent work has made them independently movable, undockable, and resizable. A user can place them almost anywhere along the edges of the figure window.

Form layout and control design: The property editor consists of a "stack" of about thirty object-specific panels. Each panel was built to be very small and efficient, providing access to the most commonly-used properties (the rest are accessible via a full-fledged property sheet). These panels share controls and visual idioms wherever possible, and their designs prefer compact, visually-oriented controls to sprawling sets of interdependent controls. Custom control design was, therefore, a major challenge in the property editor.

Technical Details

The GUIs themselves are implemented in Java Swing, but the code that integrates them with the rest of MATLAB is written in M, which is the language built into MATLAB itself. This presented cross-language communication problems, including threading -- the GUI must run on one thread, while MATLAB runs on another. I needed to keep both threads responsive (and not deadlocked, of course) whenever possible.

Maintaining "liveness" with the figure window -- in particular, the need to react immediately to changes in plots -- required some work on the event model that MATLAB plots use. For instance, the fine-grained events already being fired from plots were overwhelming the GUI, so we devised higher-level events that didn't need to be fired as often.

In keeping with all major functionality in MATLAB, the plot tools also needed their own API. Users frequently drive MATLAB from their own M programs, and we had to write functions for them to manage the display and use of the plot tools. This was also needed in-house for automated testing.

Back to Consulting Services