# Plotting a contour plot with excel data

41 ビュー (過去 30 日間)
asd ad 2020 年 8 月 12 日
コメント済み: asd ad 2020 年 8 月 13 日
Hello everyone,
I want to plot a contour plot with the attached excel data. So the colour bar on the right needs to be the RH. The x axis is basially the first column L which is relative to R1......R13. For exaomple 1*R, 2*R. The different initial R should be on the y-axis. How do I best do this?

サインインしてコメントする。

### 採用された回答

Sudheer Bhimireddy 2020 年 8 月 12 日
Import your data into a 2D array and then decide what columns you want to plot using contourf

#### 12 件のコメント

asd ad 2020 年 8 月 13 日
Relative Humidity is dependant on the x and y values because the relative humidity is different for each different R but same for the corresponding L. For example for all L which is 1R, RH will be the same. Similarly all values of R at L =2R the relative humidity will be the same
Sudheer Bhimireddy 2020 年 8 月 13 日
Ah, now I understood your data.
Try this:
R = data(1:14,16); % <- Got your R
% Initialize matrices
L = zeros(21,14);
R1 = zeros(21,14);
RH = zeros(21,14);
for i = 1:size(L,1)
L(i,:) = (i-1)*R;
R1(i,:) = R;
RH(i,:) = data(i,14);
end
contourf(L,R1,RH);
c=colorbar;
xlabel('L');ylabel('R');ylabel(c,'RH'); asd ad 2020 年 8 月 13 日
Thank you for your help :)

サインインしてコメントする。

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!