Displaying images in 3D plot

I want to place an image on the plane XY of a 3D plot box.

Is there a command to do that? The instruction ‘image’ seems to work only for 2D plots.

Thanks

The following works (incidentally?) for me:

image ()
hold on 
plot3 (1:64, 1:64, -32:31, "linewidth", 2);
view (3)

image

Be aware that you won’t be able to print to vector formats.

1 Like

And for more plexibility on the choice of the plane (images are always on (x,y)) and on the print output format, you can use pcolor.

1 Like

The same code doesn’t seem to work properly in my case…

The above code only works in Octave 6+ for me. Which version are you using? Were you more lucky with pcolor?

Actually, I just realized that pcolor won’t work on RGB images, only on indexed images. If you are still interested then the following code works for me both in Octave 5 and 6:

## Indexed (n-by-m) image
cdata = get (0, "defaultimagecdata");

hs = pcolor (cdata);
axis ("image")
set (gca, "ydir", "reverse");
set (hs, "edgecolor", "none");
hold on
plot3 (1:64, 1:64, -32:31, "-r", "linewidth", 2);
view (3)

image