Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


Harris Geospatial / Docs Center / Using IDL / Draw Multi-Sided Shapes

IDL

Draw Multi-Sided Shapes

Draw Multi-Sided Shapes

Use the POLYGON function to draw a square, rectangle, or other multi-sided shape on an existing graphic. You can use POLYGON 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 a shape that defines a study area.

mars with an irregular rectangle area

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')
 
; Define the large study area.
coords = [[116, 298],[251, 298], $
   [268, 147], [135, 147]]
 
; Draw the large study area using POLYGON.
alpha = POLYGON(coords,  TARGET=mglobe, /DATA, $
   FILL_BACKGROUND=0, COLOR='white', THICK=2)
 
; Draw the text for the large study area.
alphatext = TEXT(113, 307, TARGET=mglobe, $
   'Study Area $\alpha$', $
   COLOR='white', /DATA, FONT_SIZE=18)

Resources




© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us