Second subplot disappearing

前端 未结 1 2078
清歌不尽
清歌不尽 2020-12-19 08:22

I have a weird (and probably simple to solve) problem. I tried to plot (using panel) two plots:

a1 = subplot(2,1,1, \'Parent\', handles.cpd_plot, \'Position\         


        
相关标签:
1条回答
  • 2020-12-19 09:23

    So it is probably happening because subplot deletes a plot when it is overlapping with the previous plot. I suspect that happens because of conflicting positions values between the subplot tile number (i.e. subplot(2,1,1) etc) that has its own default position, and the position you entered.

    So instead of using subplot(m,l,p, 'position', [ a b c d]), you can solve this issue by using subplot just with the position info as follows:

    subplot('position',  [0.1, 0.4, 0.85, 0.45])
    plot(1:10);
    subplot('position', [0.1, 0.1, 0.85, 0.15])
    plot(1:10);
    

    enter image description here

    0 讨论(0)
提交回复
热议问题