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 8226015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:36:56+00:00 2026-06-07T15:36:56+00:00

I have plotted two curves using plotyy function of MATLAB: [AX,H1,H2] = plotyy(voltage_span, amplitude,voltage_span,

  • 0

I have plotted two curves using plotyy function of MATLAB:

[AX,H1,H2] = plotyy(voltage_span, amplitude,voltage_span, Ca_SR);

The problem is that I cannot change the color and font of the second axis(the right one). The following figure is the the output of my plotyy function.
enter image description here

MATLAB help states that for changing the axes’s label, one should use the followings:

set(get(AX(1),'Ylabel'),'String','Slow Decay') 
set(get(AX(2),'Ylabel'),'String','Fast Decay')

So, I tried the following commands(which doesn’t work):

set(get(AX(2),'YColor'),[1 0 1]); % MATLAB gives ERROR! Invalid handle object.

If one enters get(AX(2)), they can see all the properties of the right axis which seems not to have color property. So I am wondering where is the problem and how to change the color and font size of the right axis(?)

  • 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-07T15:36:58+00:00Added an answer on June 7, 2026 at 3:36 pm

    To change the font size of the right axis, enter the following code:

    set(AX(2),'YColor', [1 0 0]); % Change the right Axis's color to red
    set(AX(2),'FontSize', 20); % Change the right Axis's font size to 20
    

    “YColor” property is the color of the right axis. Ax(2) holds the handle to the right axis(and Ax(1) to the left axis).

    You might ask why the following does not work:

    set(get(AX(2),'YColor'),[1 0 1]);
    

    The reason is that “YColor” is not a handle and

    get(AX(2),'YColor') 
    

    simply returns the color of the right axis (which is light green by default):

    >> get(AX(2), 'YColor')
    
    ans =
    
             0    0.5000         0
    

    However, for changing the left axis’ label, you should write this:

    set(get(AX(2),'Ylabel'),'String','Fast Decay')
    

    Because ‘Ylabel’ property actually contains a handle to the label object.

    By the way, to remove the XTicks of the right axis, do this:

    set(AX(2),'XTick', []);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been currently using a Matlab script that plots a function and prints
I am trying to have two data series plotted in one graph as boxes
I have a question. I have plotted a graph using Matplotlib like this: from
I'm using Visifire. I have plotted about 500+ points on a line chart. However,
I have a graph plotted using Floa Graph Lib, and x-axis has 30 points
I have a relatively simple web app, that allows the user to enter two
I have an exercise in problem solving for those who like that kind of
Say that I have two conditions, 'a' and 'b'. A neuron fires on average
I have plotted the line between two points(locations), but i dont know how to
I have raphael paths plotted and text on its top but when two path

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.