arrange multiple 2D histograms in 3D
조회 수: 4 (최근 30일)
이전 댓글 표시
I am wondering how I can draw this figure with Matlab. Please help!
댓글 수: 0
답변 (1개)
Duncan Po
2016년 7월 14일
You can use the hist function to plot one histogram, then grab its vertices from the resulting patch object. Pass these vertices to the patch function and add a Z component to it. Like this:
hist(randn(100,1));
h = get(gca,'Children');
x = h.Vertices(:,1);
y = h.Vertices(:,2);
z = 3*ones(size(x));
close all
hist(randn(100,1)+2);
h = get(gca,'Children');
x2 = h.Vertices(:,1);
y2 = h.Vertices(:,2);
z2 = 6*ones(size(x2));
close all;
patch(x,y,z, 'r'); hold on; patch(x2,y2,z2, 'b'); view(3)
% now rotate as desired
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!