how to plot graph with color for xy vs z?

Illustration
Ruthvik sainath meka - 2023-03-22T10:49:24+00:00
Question: how to plot graph with color for xy vs z?

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  

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

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;

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!