2014-09-18 245 views
1

我已经阅读了许多关于在MATLAB中添加图像作为背景的文章,但是我想知道是否可以在MATLAB图形中添加徽标,例如右上或左上手边。添加徽标到MATLAB图

+0

所以没有任何提示的解决方案解决问题了吗? – 2014-09-29 15:34:39

+0

不完全是,我决定将轴插入我的图中,然后插入图片。然而,在说了这些之后,你的答案是两者中较好的答案,我会接受它,因为这是可能的。谢谢! – user2958395 2014-10-02 21:21:33

+0

确定没问题,谢谢!我很好奇你是如何解决你的问题的;这是一个有趣的问题:) – 2014-10-02 22:14:59

回答

0

这里。它可能不是最通用/健壮,但它可以解决你的问题:

clc; 
clear all; 

LogoImage = imread('Matlab_logo.png'); 

x=0:0.1:10; 
y=sin(x); 

figure 

subplot('Position',[0.8 0.8 0.2 0.2]) % Place the logo using the sub^plot command. 
imshow(LogoImage) 

%set(gca,'LooseInset',get(gca,'TightInset')) % Not necessary... actually it can be used to get rid of the blank space around plots. In this case it does not apply however. 

subplot(1,5,1:4) % Make the actual plot span 4 of the 5 subplots. 
plot(x,y) 

给予这样的:

enter image description here

1

你能做到这一点

>> z = peaks; z = round(255 * z/max(max(z))); 
>> x = linspace(0, 2*pi, 101); 
>> plot(x, sin(x)) 
>> hold on 
>> image([4,2*pi], [0.5,1.5], z) 
>> xlim([0, 2*pi]) 
>> ylim([-1.5, 1.5]) 

使用插曲替代解决方案,其结果如下情节

enter image description here

+0

如果我想把徽标放在图表之外怎么办? – user2958395 2014-09-18 18:03:29