Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8436337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:09:12+00:00 2026-06-10T07:09:12+00:00

I want to plot two (or more) graphs in Matlab. I want them to

  • 0

I want to plot two (or more) graphs in Matlab. I want them to be aligned one above the second one above the third and so on. However subplot is not the case for me. I also don’t want them both to be on the same graph in different colors, just to be one above the other. Is it possible? I’m searching for such a command but without any success.
Thanks in advance for hints!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:09:13+00:00Added an answer on June 10, 2026 at 7:09 am

    If what you mean by “one above the other” is one “on top of another” then I think what You need to use is the axes command. Having said that, in order to have your plot be readable, I think more than two scales in the same plot makes it pretty hard to read.

    This Matlab’s help page shows you how to do it, the gist of it is shown in the following script:

    y2 = 1000.*rand(100,1);
    x2 = 0:99;
    
    % Plot the first data set
    hl1 = line(x1,y1,'Color','r');
    % Get the axes and configure it
    ax1 = gca;
    set(ax1,'XColor','r','YColor','r')
    
    %Create the new axes
    ax2 = axes('Position',get(ax1,'Position'),...
               'XAxisLocation','top',...
               'YAxisLocation','right',...
               'Color','none',...
               'XColor','k','YColor','k');
    % Plot the second data set with the new axes
    hl2 = line(x2,y2,'Color','k','Parent',ax2);
    

    The above script creates the following plot with one set of axes in red and another in black.

    enter image description here

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to plot two graphs on one plot. I read this post ,
I want to combine two ggplots, from two different data.frames, into one plot. Below
Possible Duplicate: How to plot two histograms together in R? I want to plot
With this approach. I have a line plot graph. I want to plot 'two'
I have the data in two files. I want to plot a graph the
I want to plot a scatter plot with filled markers and make them semi-transparent
I want to plot data from different data frames with ggplot. However, I'm having
I want to plot a series of lines with one half-space filled for each
Whenever, I want to plot multiple 2d line graphs graphs with matplotlib, I define
I want to draw path from one location to other location. How to plot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.