Graphics > Graphics Gallery > Modifying Visualizations > Lines and Arrows

# Draw Lines and Arrows

Use the POLYLINE function to draw lines or arrows on existing graphics. You can use POLYLINE at the time you create the graphic, or from the command line after the graphic is displayed.

The example shows an image of Mars with an arrow that points to a landing site.

The code shown below creates the graphic shown above. You can copy the entire block and paste it into the IDL command line to run it.

; Define the image to display.

file = FILEPATH('marsglobe.jpg', $

SUBDIRECTORY = ['examples', 'data'])

; Display the mars image.

mglobe = IMAGE(file, TITLE='Mars Study')

; Draw the line pointing to the landing site.

landingsite = ARROW([[35, 251],[68,300]], $

TARGET=mglobe, /DATA, ARROW_STYLE=1, $

COLOR='blue', THICK=2)

; Draw the text for the landing site.

landtext = TEXT(11, 236, TARGET=mglobe, $

'Landing site', /DATA, COLOR='blue', FONT_SIZE=14)

## Resources

- Graphics examples
- IDL Graphics Functions
- ARROW
- ELLIPSE
- IMAGE
- POLYGON
- TEXT
- Changing graphics properties
- Multiple graphics in one window
- Save a graphic
- Formatting IDL Graphics Symbols and Lines