matlavHow to make colorbar work for a scatter3 plot?

Technical Source
2 min readMar 22, 2023

Hi,

I am plotting a set of scatter points using the below code. It works perfectly and the graph is correct. But the colorbar is just showing values between 0 and 1 and I don’t know how I can reflect the actual values of the graph.

[NUM,LETTER]= xlsread('B.xlsx','S1');
M=NUM(:,1:3);
z=M(:,2)
y=M(:,1)
x=M(:,3)
[carbon,idx]=sort(z)yyy=y(idx)xxx=x(idx)zzz=z(idx)cmp=jet(numel(z))scatter3(xxx, yyy, zzz, 15, cmp);colorbar

I would appreciate any help. Thanks

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

Eg: To use scatter and color plot

x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
c = linspace(1,10,length(x));
scatter(x,y,[],c)
colorbar

In your case try

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.