How can I plot 2D surface plot with color bar
Mostrar comentarios más antiguos
I have an excel file containing 3 variables as attached. I want to plot the variables as a 2D surface plot with the third column representing the color bar. I also attach an example of the plot I am trying to plot.
When I used surf command, I get this error:
Error using surf (line 71)
Z must be a matrix, not a scalar or vector.
Error in PTC_calculation (line 74)
surf(w_ev,beta,PTC)
Thanks
1 comentario
You cannot plot a surface plot with the data you have.
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1227857/DATA.xlsx') ;
x = T.w ;
y = T.beta ;
z = T.PTC ;
scatter(x,y,[],z)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





