help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Plot an image in 3D using surf function.


From: Cristóbal Alvarado Minic
Subject: Fwd: Plot an image in 3D using surf function.
Date: Sat, 7 Sep 2013 17:49:41 -0430

Hello all,

I am trying to plot a bitmap image using the example given in this URL:

http://stackoverflow.com/questions/3719502/how-can-i-plot-an-image-jpg-in-matlab-in-both-2-d-and-3-d

img = imread('1.jpg');     %# Load a sample image
xImage = [-0.5 0.5; -0.5 0.5];   %# The x data for the image corners
yImage = [0 0; 0 0];             %# The y data for the image corners
zImage = [0.5 0.5; -0.5 -0.5];   %# The z data for the image corners
surf(xImage,yImage,zImage,...    %# Plot the surface
     'CData',img,...
     'FaceColor','texturemap');

But the surf functions returns an error, even under the simple form

octave:7> xImage = [-0.5 0.5; -0.5 0.5];   %# The x data for the image corners
octave:8> yImage = [0 0; 0 0];             %# The y data for the image corners
octave:9> zImage = [0.5 0.5; -0.5 -0.5]; 
octave:10> surf(xImage,yImage,zImage,'CData',img)
error: __go_draw_axes__: invalid grid data
error: called from:
error:   /usr/share/octave/3.6.4/m/plot/private/__go_draw_axes__.m at line 1143, column 15
error:   /usr/share/octave/3.6.4/m/plot/private/__go_draw_figure__.m at line 167, column 19
error:   /usr/share/octave/3.6.4/m/plot/__gnuplot_drawnow__.m at line 86, column 5

Is this a lack of compatibility between Matlab and Octave, or am I missing something?

Thank you in advance,

Chris.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]