how to plot graph with color for xy vs z?

55 ビュー (過去 30 日間)
Ruthvik sainath meka
Ruthvik sainath meka 2019 年 7 月 23 日
コメント済み: Michael Madelaire 2019 年 7 月 23 日
I want to plot a graph showing me XY values for perticulur Z value
i want z as a colour
so i will get the data as XY for pertuculur Z

採用された回答

Michael Madelaire
Michael Madelaire 2019 年 7 月 23 日
I think you are looking for a scatterplot.
clear all; close all; clc;
x = rand(100,1);
y = rand(100,1);
z = rand(100,1);
figure();
scatter(x,y,20,z);
xlabel('x');
ylabel('y');
c = colorbar;
c.Label.String = 'z';
grid on;
  2 件のコメント
Ruthvik sainath meka
Ruthvik sainath meka 2019 年 7 月 23 日
i want to get a plot like this
Capture2.PNG
i have data
Capture.PNG
i want a plot x,y as drain voltage, gate voltage and z as current
x,y and z should give the colour so that i can understand from the intensty graph that for a perticolour x,y this current is there
Michael Madelaire
Michael Madelaire 2019 年 7 月 23 日
This should do it.
clear all; close all; clc;
x = rand(100, 1);
y = rand(100, 1);
z = rand(100, 1);
[xx, yy] = meshgrid(x, y);
zz = griddata(x, y, z, xx, yy);
figure()
[~, h] = contourf(xx,yy,zz,10);
set(h, 'LineColor', 'none');
xlabel('x');
ylabel('y');
c = colorbar;
c.Label.String = 'z';

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrange についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by