1.264 FAQ-1068 How to insert a graph background image and link to layer scales?

Last Update: 12/5/2024

Contents

Origin 2025 and Later

  1. With the graph window active, choose Insert: Image from File to insert it into the graph.
  2. Right-click on the inserted image and select Set as Layer Background.


A couple things to note:

LayerBackgroundProperties.png

Origin 2022 to 2024b

  1. With the graph window active, choose Insert: Image from File and open your image file.
  2. Double-click the inserted image to open it in a separate Image Window.
  3. Right-click on the image in the Image Window and select Set as Layer Background.

Origin 2021b

  1. With the graph window active, choose Insert: Image from Files. An attention message asks Do you want to insert as layer background?

Origin 2021 and Earlier

Origin has an X-Function named insertImg2g that is used to insert images into graph windows. While implemented primarily to support Origin's Google Map Import App, you can use it on its own to insert a raster image into the background of any graph and lock the image to the containing layer's scales.

  1. Once you import the image, any change in axis scales will crop the image so adjust axis scales beforehand if need be.
  2. Open the Script Window (Window: Script Window), enter the following two lines of code, then highlight both of them and press Enter:
    dlgfile g:="*.PNG"; // can substitute any supported raster file type for .PNG
    insertImg2g type:=img xyp:=2;
  3. An Open dialog will prompt you to pick your image file. Click OK and the image will be inserted into the graph background with the following characteristics:

Keywords:raster, insert image, layer and scales, object attachment