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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:21:31+00:00 2026-05-16T06:21:31+00:00

I am new to matplotlib and I am trying to figure out if I

  • 0

I am new to matplotlib and I am trying to figure out if I can repeat the y axis scale
values along the grid lines of the line graph.

The graph has 2 axis,
x-axis has hourly values and y-axis has temperature values.

I need to show the graph for 48 hours, so it results in a long horizontal graph. when user scrolls through the graph horizontally he has x-axis scale available for reference but
y axis scale is way towards left and is not visible.

I need a way to repeat the y-axis scale(temperature values) along all the graph. Is there any way to achieve this?

Is there any better solution to this problem, apart from repeating the values?

  • 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-16T06:21:32+00:00Added an answer on May 16, 2026 at 6:21 am

    You might take a look at the colorbar from this example:

    import matplotlib.pyplot as plt
    import numpy as np
    from matplotlib.collections import EllipseCollection
    
    x = np.arange(10)
    y = np.arange(15)
    X, Y = np.meshgrid(x, y)
    
    XY = np.hstack((X.ravel()[:,np.newaxis], Y.ravel()[:,np.newaxis]))
    
    ww = X/10.0
    hh = Y/15.0
    aa = X*9
    
    
    ax = plt.subplot(1,1,1)
    
    ec = EllipseCollection(
                            ww,
                            hh,
                            aa,
                            units='x',
                            offsets=XY,
                            transOffset=ax.transData)
    ec.set_array((X+Y).ravel())
    ax.add_collection(ec)
    ax.autoscale_view()
    ax.set_xlabel('X')
    ax.set_ylabel('y')
    cbar = plt.colorbar(ec)
    cbar.set_label('X+Y')
    plt.show()
    

    A quick experiment shows me that you can pan/zoom the main window and the colorbar will stay constant.

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

Sidebar

Related Questions

New to all this so forgive my ignorance. I am trying to figure out
I am new to using matplotlib. I am trying to create a 2D grid,
I'm new to python and have been trying to figure this out all day.
I am trying to migrate over to Python from Matlab and can't figure out
I am using matplotlib to plot a graph with the points ([0,0,0],[0,0,1],[0,0,2],...[255,255,255]) on x-axis
I'm very new to python. two days. trying to get a plot working with
I am trying to adapt the underlying structure of plotting code (matplotlib) that is
I create a figure and fill it with a couple of subplots. As new
I have a problem with Matplotlib 1.0.1 I create a figure, and the I
I have a matplotlib figure that I want to be able to switch between

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.