zoukankan      html  css  js  c++  java
  • Matlab用figure;subplot后合并子图

    MATLAB作图时,如果带有子图,可用subplot作图。如果需要一个规则的网格,直接制定subplot(m,n,p),即可画出m×n的子图排列中的第p个。但是如果需要不规则的,如2×2的格子中,两个小图分别占上面的两个subplot,一个长图要占据下面两个格子,此时要用subplot(2,2,[3,4])来实现。
    如果选定的 [ ] 内的两个数不在同一个行列,那么就表示以小数作为左上角,大数作为右下角的矩形框围成的区域。

    % 一个栗子
    figure;
    subplot(2,2,1)
    imagesc(synring(t0:t1,x0:x1))
    set(gca,'xtick',[1,50:50:200])
    set(gca,'xticklabel',[301,350:50:500])
    set(gca,'ytick',[1,50:50:200])
    set(gca,'yticklabel',[201,250:50:400] .* dt)
    xlabel({'Trace Number';'(a)'})
    ylabel('Time (ms)')
    colormap(gray)
    subplot(2,2,2)
    imagesc(synsection(t0:t1,x0:x1))
    set(gca,'xtick',[1,50:50:200])
    set(gca,'xticklabel',[301,350:50:500])
    set(gca,'ytick',[1,50:50:200])
    set(gca,'yticklabel',[201,250:50:400] .* dt)
    xlabel({'Trace Number';'(b)'})
    ylabel('Time (ms)')
    colormap(gray)
    subplot(2,2,[3,4])
    h1 = plot(t0:t1,synsection(t0:t1,selected_trace));
    hold on
    h2 = plot(t0:t1,synring(t0:t1,selected_trace));
    set(h1,'LineWidth',1.5)
    set(h2,'LineWidth',1.5)
    set(gca,'xtick',[201,250:50:400])
    set(gca,'xticklabel',[201,250:50:400] .* dt)
    xlabel({'Time (ms)';'(c)'})
    ylabel('Amplitude (normalized)')
    h = legend('synthetic data without ringing', 'bandpass filtereddata with ringing');
    set(h,'Box','off')
    set(h, 'Fontsize',9)
    colormap(gray)

    这里写图片描述

  • 相关阅读:
    爬虫之暴力字典生成器
    爬虫之自动生成url
    数字、大小写字母的字符编码
    对avalonjs的研究
    求墙之间有多少水洼
    2.在centos7虚拟机搭建nginx网站
    P1250 种树
    暂时用笔记
    羊村的OI题解
    P1083 借教室
  • 原文地址:https://www.cnblogs.com/morikokyuro/p/13256728.html
Copyright © 2011-2022 走看看