如何在一张图片中绘制2个图形? [英] How to plot 2 graphics in one picture?
本文介绍了如何在一张图片中绘制2个图形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码来绘制一张图形:
I have the following code to plot one graphic:
plot(softmax(:,1), softmax(:,2), 'b.')
然后用这个绘制另一个:
and then this one to plot another:
plot(softmaxretro(:,1), softmaxretro(:,2), 'r.')
现在,我希望能够在同一位置绘制两个图形.我该怎么办?
Now I'd like to be able to plot both ones in the same place. How can I accomplish that?
推荐答案
解决方案#1:在同一根轴上绘制两组点
plot(softmax(:,1),softmax(:,2),'b.', softmaxretro(:,1),softmaxretro(:,2),'r.')
,或者您可以使用hold
命令:
or you can use the hold
command:
plot(softmax(:,1), softmax(:,2), 'b.')
hold on
plot(softmaxretro(:,1), softmaxretro(:,2), 'r.')
hold off
解决方案2:在同一幅图中并排绘制各个轴
subplot(121), plot(softmax(:,1), softmax(:,2), 'b.')
subplot(122), plot(softmaxretro(:,1), softmaxretro(:,2), 'r.')
这篇关于如何在一张图片中绘制2个图形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文