3D Graph (bar3?) with two vectors and one matrix

조회 수: 5 (최근 30일)
Carlos  Vázquez Rodríguez
Carlos Vázquez Rodríguez 2021년 10월 13일
답변: Alamanda Ponappa Poovaya 2021년 11월 2일
Dear community,
I am triying to use 'bar3' to obtain a 3D bar graph from three differebt datasets:
  • A vector time(426x1 double)
  • A vertor Xaxis(40x1 double)
  • A matrix FlowRate(426x40 double)
As you can guess, the objecitve is to plot the evolution of the FlowRate (Z-axis) along the time(Y-axis) at several locations (X-axis). Is this possible with 'bar3'? Or should I find another alternative?
Thank you in advance!

답변 (1개)

Alamanda Ponappa Poovaya
Alamanda Ponappa Poovaya 2021년 11월 2일
As per my understanding, you will not get the type of output you want with bar3. Refer to the documentation of bar3
How it works is you provide a matirx Z, and bar3(Z) will plot a bar graph where each bar corresponds to one element of Z and has the height of that element.
I would suggest you use stem3 instead, this should give you the result you expect
% x 40x1 double
% y 426x1 double
% FlowRate 426x40 double
[X,Y] = meshgrid(x,y);
% X, Y 426x40 double
stem3(X,Y,FlowRate)
Documentation

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by