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

  • SEARCH
  • Home
  • 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 7420211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:12:02+00:00 2026-05-29T08:12:02+00:00

This should be quite simple, although I was not able to find a solution

  • 0

This should be quite simple, although I was not able to find a solution in the Matlab docs.

I have to plot two or more sets of data, that can be fit in two different ranges. So I can use plotyy to manage this.

What I want to do, is being able, once created a plot, to overwrite or simple add traces to one of the two axes, selectively. I tried to catch the parameters returned by plotyy, but I wasn’t able to decypher them.

Any help is appreciated.

  • 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-05-29T08:12:02+00:00Added an answer on May 29, 2026 at 8:12 am

    The MATLAB documentation on plotyy states that

    [ha, h1, h2] = plotyy(...)
    

    returns the handles of the two axes created in ha and the handles of the graphics objects from each plot in h1 and h2. ha(1) is the left axes and ha(2) is the right axes.

    So the first argument returned by plotyy is a handle to each of the axes created. To plot on the left axis use plot(ha(1), x, y) and to plot on the right axis use plot(ha(2), x, y).

    If you don’t need the handles to the graphics objects plotted, you can just use ha = plotyy(...). Otherwise, h1 and h2 returns the handles to the lines (or other graphics object) plotted in the call to plotyy. So, following the example in the documentation, setting the line styles of the two lines can be done like so:

    set(h1, 'LineStyle', '--')
    set(h2, 'LineStyle', ':')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be a simple question, but I haven't been able to find a
This should be quite simple really - not sure what the problem is. I
Ok, firstly I have the following code working.. although my question is this; should
So this should be quite simple but just want to see if I got
This feels quite complicated to ask, and whilst the solution seems simple, the shear
This should be quite a simple problem, I've come across it enough that there
This one should be quite simple. But I've been stuck with it for a
This should be simple, but for reason I can't quite fathom it doesn't work
I guess this is a quite simple (read: very simple) question, but I have
Hey guys, this should be quite simple to answer.... Im using XSB Prolog...trying to

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.