hF=figure; % make new figure, save handle to it X=[0;500;800;1000]; % given X values Y=[0;0;0;0]; % need Y for 3d plot even if 0 Z=[0;10*500;10*500;10*500+200*10]; % Z based on description given of line hL=plot3(X,Y,Z) % make the 3D plot, save handle if want modify properties hAx=gca; % get the handle for current axes to mung on 'em xlabel('X'),ylabel('Y') % obvious?? ylim([-10,10]) % shrink the y-axis grid on % make grid show up for accent rat=get(hAx,'DataAspectRatio'); % retrieve the axis ratio array rat(1)=1; % shorten the x-ratio to shrink y/z sizes comparatively--arbitrary set(hAx,'DataAspectRatio',rat) % reset to that ratio
The only tricky part is that of setting the plot aspect ratio to make it look long and skinny like the original; read up on how that works--do a search in the doc search for dataaspectratio and you'll find a section on 'Manipulating Axes Aspect Ratio' that 'splains all about it.
hAx.ZTtick=[0 10000]; hAx.FontSize=6; y=[1 1 1]*0.95; hF.Color=y;
from which to start...albeit the background shading doesn't seem to show here as it does on monitor for some reason(*)...salt to suit.
(*) Oh, all that gets saved is the axes, not the full figure in the jpeg...
Z=[0;10*500;10*500;10*500+200*10]; % Z based on description given of line
Clearly the above way to generate the Z values is only sensible when there are so few segments and the line definition/values are such as to make it trivial to write what each line segment end values are by inspection.