Domanda

I'm trying to plot many 2D plots (x,y).

But... each 2D plot is for a constant z.

So really my data is (x,y,z) but not z(x,y), which I believe are the requirements for using the "surf" command.

Could anyone help with this?

Example, x = velocity y = drag

I have multiple runs of y(x) for a constant temperature, z.

I just want to plot each (x,y) along a 3rd axis, temperature z.

Ideally I'd also want some sort of contour between the (x,y) plots so I can show the peaks/troughs etc.

Any help would be great.

È stato utile?

Soluzione

If the runs are not independent (there is some trend over multiple runs) then it may make sense to use surf. You then need to construct your data such you have an X,Y, and Z - in this case I'd suggest you use the drag measurements as your Z (height).

Assuming that you have all the drag/velocity data in drag and velocity which are both of size [data points x number of runs]:

% construct matrix of run numbers
runs = repmat(1:numruns, [1, datapoints]); 
runs = reshape(runs, datapoints, numruns);

% plot and label
surf(runs,velocity,drag);
xlabel('runs')
ylabel('velocity')
zlabel('drag')
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top