Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One possibility you can try is to create 3 axes stacked one on top of the other with the <code>'Color'</code> properties of the top two set to <code>'none'</code> so that all the plots are visible. You would have to adjust the axes width, position, and x-axis limits so that the 3 y axes are side-by-side instead of on top of one another. You would also want to remove the x-axis tick marks and labels from 2 of the axes since they will lie on top of one another.</p> <p>Here's a general implementation that computes the proper positions for the axes and offsets for the x-axis limits to keep the plots lined up properly:</p> <pre><code>%# Some sample data: x = 0:20; N = numel(x); y1 = rand(1,N); y2 = 5.*rand(1,N)+5; y3 = 50.*rand(1,N)-50; %# Some initial computations: axesPosition = [110 40 200 200]; %# Axes position, in pixels yWidth = 30; %# y axes spacing, in pixels xLimit = [min(x) max(x)]; %# Range of x values xOffset = -yWidth*diff(xLimit)/axesPosition(3); %# Create the figure and axes: figure('Units','pixels','Position',[200 200 330 260]); h1 = axes('Units','pixels','Position',axesPosition,... 'Color','w','XColor','k','YColor','r',... 'XLim',xLimit,'YLim',[0 1],'NextPlot','add'); h2 = axes('Units','pixels','Position',axesPosition+yWidth.*[-1 0 1 0],... 'Color','none','XColor','k','YColor','m',... 'XLim',xLimit+[xOffset 0],'YLim',[0 10],... 'XTick',[],'XTickLabel',[],'NextPlot','add'); h3 = axes('Units','pixels','Position',axesPosition+yWidth.*[-2 0 2 0],... 'Color','none','XColor','k','YColor','b',... 'XLim',xLimit+[2*xOffset 0],'YLim',[-50 50],... 'XTick',[],'XTickLabel',[],'NextPlot','add'); xlabel(h1,'time'); ylabel(h3,'values'); %# Plot the data: plot(h1,x,y1,'r'); plot(h2,x,y2,'m'); plot(h3,x,y3,'b'); </code></pre> <p>and here's the resulting figure:</p> <p><img src="https://i.stack.imgur.com/jIMQI.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload