MATHEMATICA TUTORIAL

# Drawing Tools

## Opening the Palette

Type Ctrl+D (T on MacOSX) or choose Graphics ► Drawing Tools.

For more information on each tool, click the words pointing into the palette.

## Selecting a Tool

Do one of the following:

• Click a tool icon on the palette.
• With a graphic selected, type one of these characters: o, r, d, g, a, p, t, b, c, s, l, f, m, e, ..

## Persistence of Tools

Do one of the following:

• Click a tool button to use a tool once. After the single use, the tool will automatically revert to the Selection tool.
• Double-click a tool button to keep using the tool.

## Tools

### Selection Tool

You can use the Selection tool to select a graphics primitive as a whole. The selection is indicated by a frame with handles.

You can scale the selection by dragging a handle. To scale equally in both directions, Shift+drag a handle.

You can move an object by dragging it.

You can remove or add an object to a selection with Shift+click.

You can select multiple objects by dragging out a rectangular region.

When an object is completely underneath another one, dragging makes it visible. You can then drag it by dragging its highlight.

For more information on how to use the Selection tool, see "Interactive Graphics: Selecting".

### Draw Arrow Tool

Click the Draw Arrow tool and drag the pointer () to draw an arrow. Hold down the Shift key to draw the arrow horizontally or vertically.

You can set arrow styles with the Stroke section.

### Draw Freehand Tool

Click the Draw Freehand tool button and drag the pointer () to draw a curve.

Double-click the Draw Freehand tool to draw multiple curves.

### Draw Line Tool

Click the Draw Line tool and drag the pointer () to draw a single line. Hold down the Shift key to draw a horizontal or vertical line.

You can set line styles with the Stroke section.

### Draw Line Segments Tool

Click the Draw Line Segments tool and drag the pointer () to draw a multi-segment line. You get a new segment after each click. To stop, double-click the last point or single-click the first point.

You can set line styles with the Stroke section.

### Draw Point Tool

Click the Draw Point tool and then click to draw a point.

You can set point styles with the Points section.

### Place Text Tool

You can place text in a graphic with the Place Text tool.

You can set text styles with the Text section.

You can place TraditionalForm text in a graphic with the Place TraditionalForm Text tool.

You can set text styles with the Text section.

### Draw Rectangle Tool

Click the Draw Rectangle tool and drag the pointer () to draw a rectangle. Hold down the Shift key to draw squares.

You can set face and edge styles with the Fill and Stroke sections, respectively.

### Draw Polygon Tool

Click the Draw Polygon tool and drag the pointer () to draw a polygon. You get a new segment after each click. To stop, double-click the last point or single-click the first point.

You can set face and edge styles with the Fill and Stroke sections, respectively.

### Draw Disk Tool

Click the Draw Disk tool and drag the pointer () to draw a disk or an ellipse.

Hold down the Shift key to draw circles.

### Draw Circle Tool

Click the Draw Circle tool and drag the pointer () to draw an unfilled circle or ellipse.

Hold down the Shift key to draw circles.

### Sample Style Tool

Select a graphics object and click the Sample Style tool.

Click on another graphics object to update the styles of the selection to match.

Ctrl (Cmd on MacOSX)+click on another graphics object to change the selection after choosing the tool (prior to sampling).

### Get Coordinates Tool

Click the Get Coordinates tool and move the mouse pointer () over a 2D graphic or a 2D plot. The approximate coordinate values of the mouse position are displayed.

Click to mark the coordinates. Click at other positions to add markers. You can delete markers with Ctrl (Cmd on MacOSX)+click.

Use Ctrl (Cmd on MacOSX)+C to copy the marked coordinates to the clipboard. Use Ctrl (Cmd on MacOSX)+V to paste the copied coordinate values into an input cell.
Use Alt+drag to mark a rectangle and Ctrl (Cmd on MacOSX)+C to copy the coordinates of the opposite corners.

Use Ctrl (Cmd on MacOSX)+V to paste.
Drag to mark a coordinate path, then type Ctrl (Cmd on MacOSX)+C to copy the coordinates.

Paste the coordinates into an input cell.

## Operations

### New Graphic

Do one of the following:

• Type Ctrl+1.
• Click the New button on the palette.

### Group

Select multiple graphics objects and do one of the following:

• Click the Group button on the palette.
• Right-click on one of the objects or the frame highlight and choose Group.
• Choose Graphics ► Group.
Dashed frame highlight indicates grouped graphics objects.

Select a graphics group and do one of the following:

• Click the Ungroup button on the palette.
• Right-click on one of the objects or the frame highlight and choose Ungroup.
• Choose Graphics ► Ungroup.
Ungrouping returns the regular multiple selection highlight.

### Arrange

You can use these operations to change the order of overlapping objects.

Select an object in overlapping graphics and do one of the following to move it to the back:

• Click the Move to Back button on the palette.
• Right-click on the object and choose Move to Back.
• Choose Graphics ► Move to Back.

Use Move to Front to move an object to the front of all others.

Use Move Backward to move a graphics object to the back of the object immediately below it.

Use Move Forward to move a graphics object to the front of the object immediately above it.

### Align

You can use these operations to align multiple graphics objects.

Select multiple graphics objects and do one of the following to align them on the left:

• Click the Align Left Sides button on the palette.
• Choose Graphics ► Align Left Sides.

Use Align Centers Vertically to center align the objects in the vertical direction.

Use Align Right Sides to align the objects on the right.

Use Align Bottoms to align the bottoms of the objects.

Use Align Centers Horizontally to center align the objects in the horizontal direction.

Use Align Tops to align the tops of the objects.

### Distribute

You can use these operations to control the space between selected graphics objects.

Select more than two graphics objects and do one of the following to equally space the left sides of each object:

• Click the Distribute Left Sides button on the palette.
• Choose Graphics ► Distribute Left Sides.

Use Distribute Centers Horizontally to space the centers equally in the horizontal direction.

Use Distribute Right Sides to equally space the right sides of the objects.

Use Distribute Space Horizontally to leave an equal amount of horizontal space between the objects.

Use Distribute Tops to equally space the tops of the objects.

Use Distribute Centers Vertically to space the centers equally in the vertical direction.

Use Distribute Bottoms to equally space the bottoms of the objects.

Use Distribute Space Vertically to leave an equal amount of vertical space between the objects.

## Styles and Attributes

Do one of the following:

• Select a graphics object and then use the controls in the palette to change its styles or attributes.
• Use the controls to set desired styles or attributes (before or after selecting a tool) and then draw a graphics object.
• Select a graphics object and then draw another object to reuse the styles and attributes of the former selection.

### Fill

Use the Fill section to modify the face color and opacity of shapes such as Rectangle, Disk, and Polygon.

### Stroke

Use the Stroke section to modify the color, opacity, thickness, dashing, and caps and joins styles of linear graphics objects such as Line, Circle, and Arrow.

You can also use the Stroke section to modify the edge styles of shapes such as Rectangle, Disk, and Polygon.

Use the Arrowheads section to modify the appearance, position, and size of arrowheads.

### Text

Use the Text section to modify font styles and attributes inside graphics.

### Points

Use the Points section to change the color and size of points.

### Rectangles

Use the Rectangles section to create rectangles with rounded corners.

### Color Selector

Click the color swatch under Fill, Stroke, Text Foreground, or Text Background to bring up a color selector palette.

Click the spectrum to select the currently shown color in the top-left corner.

You can also click one of the wells to select the displayed color.

Drag the color swatch for quick access to the color selector palette. Release the mouse to select the current color.

Drag a color onto one of the wells to store it.

Click the button next to the color swatch to access the system color selector palette.

## Settings

### Alignment Guides

Use the alignment guides to align a graphics object within a graphic.

You can also use the alignment guides to align with another graphics object.

Temporarily disable the alignment guides while dragging by pressing the Alt key.

### Reset

Reset the styles and attributes of the current selection as well as subsequently drawn graphics objects.

## Tutorial CollectionTutorial Collection

New to Mathematica? Find your learning path »
Have a question? Ask support »