Credits | Overview | Plotting Styles | Commands | Terminals
--- | --- | --- | --- | ---

## pixmap

Syntax:

          set pixmap <index> {"filename" | colormap <name>}
                     at <position>
                     {width <w> | height <h> | size <w>,<h>}
                     {front|back|behind} {center}
          show pixmaps
          unset pixmaps
          unset pixmap <index>

The set pixmap command is similar to set object in that it defines an object that will appear on subsequent plots. The rectangular array of red/green/blue/alpha values making up the pixmap are read from a png, jpeg, or gif file. The position and extent occupied by the pixmap in the gnuplot output may be specified in any coordinate system (see coordinates). The coordinates given by at <position> refer to the lower left corner of the pixmap unless keyword center is present.

If the x-extent of the rendered pixmap is set using width <x-extent> the aspect ratio of the original image is retained and neither the aspect ratio nor the orientation of the pixmap changes with axis scaling or rotation. Similarly if the y-extent is set using height <y-extent>. If both the x-extent and y-extent are given using size <x-extent> <y-extent> this overrides the original aspect ratio. If no size is set then the original size in pixels is used (the effective size is then terminal-dependent).

Pixmaps are not clipped to the border of the plot. As an exception to the general behaviour of objects and layers, a pixmap assigned to layer behind is rendered for only the first plot in a multiplot. This allows all panels in a multiplot to share a single background pixmap.

Examples:

          # Use a gradient as the background for all plotting
          # Both x and y will be resized to fill the entire canvas
          set pixmap 1 "gradient.png"
          set pixmap 1 at screen 0, 0 size screen 1, 1 behind

          # Place a logo at the lower right of each page plotted
          set pixmap 2 "logo.jpg"
          set pixmap 2 at screen 0.95, 0 width screen 0.05 behind

          # Place a small image at some 3D coordinate
          # It will move as if attached to the surface being plotted
          # but will always face forward and remain upright
          set pixmap 3 "image.png" at my_x, my_y, f(my_x,my_y) width screen .05
          splot f(x,y)

Subtopics

- pixmap from colormap