matlab绘制三组xy的三维列式水平直方图代码
时间: 2023-03-29 17:00:17 浏览: 91
以下是绘制三组xy的三维列式水平直方图的 MATLAB 代码:
```matlab
% 生成数据
x = [1 2 3 4 5];
y = [1 2 3];
z1 = [1 2 3; 4 5 6; 7 8 9; 10 11 12; 13 14 15];
z2 = [15 14 13; 12 11 10; 9 8 7; 6 5 4; 3 2 1];
z3 = [1 3 5; 7 9 11; 13 15 17; 19 21 23; 25 27 29];
% 绘制图形
figure;
bar3h(x, z1, y, 'hist');
hold on;
bar3h(x, z2, y, 'hist');
bar3h(x, z3, y, 'hist');
xlabel('X');
ylabel('Y');
zlabel('Z');
title('三组xy的三维列式水平直方图');
```
希望能对您有所帮助!
相关问题
matlab绘制三组xy的队三维列式水平直方图代码
以下是 Matlab 绘制三组 xy 的三维列式水平直方图的代码:
```matlab
x = [1 2 3 4 5];
y1 = [2 4 6 8 10];
y2 = [1 3 5 7 9];
y3 = [10 8 6 4 2];
figure;
bar3h([y1' y2' y3'], 'grouped');
set(gca, 'yticklabel', x);
xlabel('Y');
ylabel('X');
zlabel('Z');
title('三组 XY 的三维列式水平直方图');
```
希望能对您有所帮助。
matlab绘制三组xy的三维分组式水平直方图代码
以下是 Matlab 绘制三组 xy 的三维分组式水平直方图的代码:
```matlab
x = [1 2 3 4 5];
y1 = [2 3 4 5 6];
y2 = [3 4 5 6 7];
y3 = [4 5 6 7 8];
figure;
hold on;
bar3h(x, [y1' y2' y3'], .5, 'grouped');
xlabel('X');
ylabel('Y');
zlabel('Z');
title('三维分组式水平直方图');
hold off;
```
希望对你有帮助。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)