how to plot graph with color for xy vs z?

조회 수: 16 (최근 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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by