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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:19:16+00:00 2026-05-26T02:19:16+00:00

The tracker in the lower-right corner (highlighted in red) reports y-values relative to the

  • 0

enter image description here

The tracker in the lower-right corner (highlighted in red) reports y-values relative to the y-axis on the right.

How can I get the tracker to report y-values relative to the y-axis on the left instead?

import matplotlib.pyplot as plt
import numpy as np

np.random.seed(6)
numdata = 100
t = np.linspace(0.05, 0.11, numdata)
y1 = np.cumsum(np.random.random(numdata) - 0.5) * 40000
y2 = np.cumsum(np.random.random(numdata) - 0.5) * 0.002

fig = plt.figure()

ax1 = fig.add_subplot(111)
ax2 = ax1.twinx()

ax1.plot(t, y1, 'r-', label='y1')
ax2.plot(t, y2, 'g-', label='y2')

ax1.legend()
plt.show()

I know swapping y1 with y2 will make the tracker report y1-values,
but this also places the y1 tickmarks on the right-hand side, which is not what I want to happen.

ax1.plot(t, y2, 'g-', label='y2')
ax2.plot(t, y1, 'r-', label='y1')
  • 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-26T02:19:17+00:00Added an answer on May 26, 2026 at 2:19 am

    Ah, found it: ax.yaxis.set_ticks_position("right").
    Instead of trying to “control the tracker”, you can swap the location of the y-axes.

    ax1.yaxis.set_ticks_position("right")
    ax2.yaxis.set_ticks_position("left")
    
    ax1.plot(t, y2, 'g-', label='y1')
    ax2.plot(t, y1, 'r-', label='y2')
    

    AFAIK, the tracker always follows ax2 when using twinx.

    enter image description here

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

Sidebar

Related Questions

I am trying to query a bittorrent tracker and am using unpack to get
I tried pinging tracker.thepiratebay.org and for some reason the DNS returns 127.0.0.1 I get
I am attempting to create a simple tracker using php and google maps. Right
I'm considering putting the Google Analytics tracker on my blog to get better stats
Using Github's Issue Tracker, how can one create an issue tied to an organization
Bitbucket has an issue tracker, can it be turned into Mylyn tasks?
For some reason the allocation tracker is disabled in my ddms.. i can see
I'm trying to get the 301 URL Tracker package for Umbraco to work to
I am creating an expense tracker kind of application. My requirement is to get
I found a ticket in our issue tracker that one of customers report a

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.