3d Bar plot on map

조회 수: 9 (최근 30일)
Ranjan Sonalkar
Ranjan Sonalkar 2018년 5월 30일
댓글: Ranjan Sonalkar 2018년 5월 31일
I have a floor plan in a .jpeg or .png file, that I can read and display with the function image with the x-y coordinates. I also have another quantity, z, for a few, N, selected x-y locations of the floor coordinates. I would like to draw 3D bars at the appropriate N locations corresponding to the values of z. Would appreciate any help to do this.

채택된 답변

Rishabh Rathore
Rishabh Rathore 2018년 5월 31일
편집: Rishabh Rathore 2018년 5월 31일
You can plot image as a surface (on x-y plane) using the following code
%Insert Image
Z=imread('img.jpg');
[X,map]=rgb2ind(Z,256);
x=1:25; %change x,y to suite your requirements
y=1:25;
[xx,yy]=meshgrid(x,y);
zz=zeros(size(xx));
colormap(map)
surf(xx,yy,zz,X,'FaceColor','texturemap','EdgeColor','none','CDataMapping','direct');
After that use the function provided in the link below to plot the bar graph.
  댓글 수: 3
Rishabh Rathore
Rishabh Rathore 2018년 5월 31일
As for plotting of image is concerned, the size would be adjusted to fit your x,y grid, you probably won't have to worry about it. And for bar graph I have changed my answer a bit, please check that out.
Ranjan Sonalkar
Ranjan Sonalkar 2018년 5월 31일
that works. Thanks for the help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by