Making a contour plot with 1-D z values?

I have experiemntal splash data with X being the Weber number Y being the Reynolds number and Z being a number (1-5) depending on the splash pattern. I am trying to vissulize this data by using a contour plot but cannot figure out to format my code since my Z is not a matrix. I have attached my data and any help would be greatly appreciated. I have been able to create the contour plot attached but I need smooth lines and only integers in the legend. I would like my plot to look like similar to the screen shot uploaded.

2 件のコメント

darova
darova 2019 年 8 月 21 日
What is 'Splash data.txt'? How to read it?
Bailey Basso
Bailey Basso 2019 年 8 月 22 日
Sorry about that I tried to reupload the data so it can be read. Let me know if 'Book1.txt' is readable.

回答 (1 件)

darova
darova 2019 年 8 月 22 日

0 投票

You dont so much points for meshgrid, just make FaceColor - interp
F = scatteredInterpolant(Re,We,PS);
PSg = F(Reg,Weg);
h = pcolor(Reg,Weg,PSg);
set(h,'FaceColor','interp')
set(h,'EdgeCOlor','none')
caxis([0 5])
hc = colorbar;
set(hc,'YTick',0:5)
set(hc,'YTickLabel',0:5)
xlim([0 6000])
ylim([0 2000])

4 件のコメント

Bailey Basso
Bailey Basso 2019 年 8 月 22 日
So this cleaned the graph up a little but is there a way to make the graph look like the screenshot I just uploaded?
darova
darova 2019 年 8 月 22 日
You mean lines?
img1.pn1.png
If you want to color some area - use patch()
Bailey Basso
Bailey Basso 2019 年 8 月 22 日
Not sure if I totally know how to use patch() but I will work on it.
darova
darova 2019 年 8 月 22 日
Just draw a line
img1.png
h = patch(x,y,'r');
alpha(h,0.3) % transparency

この質問は閉じられています。

タグ

質問済み:

2019 年 8 月 21 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by