Matlab Bar和Plot在同一图中

时间:2014-03-31 03:08:27

标签: matlab plot

我试图在Matlab中将1个条形图和2个图形放在1个图形中,但显示屏似乎存在问题。

第一张图显示了使用绘图绘制所有3张图的时间。

The figure when all 3 graphs are plotted using plot 下一个图像显示使用条形图绘制第一个图形时的情况以及剩余的使用绘图。 When the first graph is plotted using bar and the remaining using plot
你会注意到2个情节变得非常奇怪。渲染确实有些东西,但我不确定。以下是用于生成这些数字的代码:

figure;
subplot(311);
hl = plot(time,data);datetick('x', 8);title('PIR sensor');hax=get(hl,'Parent');set(hax,'XGrid','on');
subplot(312);    
hl = plot(time,y1);datetick('x', 8);title('Gas Sensor 1');hax=get(hl,'Parent');set(hax,'XGrid','on');ylim([600 1600]);
subplot(313);
hl = plot(time,y2);datetick('x', 8);title('Gas Sensor 2');hax=get(hl,'Parent');set(hax,'XGrid','on');ylim([0 600]);

0 个答案:

没有答案