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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:33:11+00:00 2026-06-01T01:33:11+00:00

I am trying to put two scatter plots next to each other with a

  • 0

I am trying to put two scatter plots next to each other with a shared y axis, but the axis seems to get an odd scale. Without the shared axis the two plots look fine. I also noticed that the problem does not occur when using “plot” instead of “scatter”. Images are included below. Here is the code I am using.

#!/usr/bin/python

import matplotlib.pyplot as plt

fig = plt.figure(1)
for i in range(1,3):
    if i == 1:
        ax = fig.add_subplot(1,2,i)
    else:
        fig.add_subplot(1,2,i, sharey=ax)

    #plt.plot([5.0], [1],marker="*",color='tomato')
    plt.scatter([5.0], [1], s=20, color='tomato')

plt.show()

[I would include images but the site won’t let me as a newbie.] When I run the code above I see plots with a y axis that runs from 0.0000 to 0.0008 with a single point plotted at 0.0004. Without shared axes the y axis goes from 0.94 to 1.06 with a single point plotted at 1.00, as expected.

Can anyone tell me why? Is this a bug or a feature?

matplotlib: 0.99.1.2-3ubuntu on Ubuntu 10.04 LTS – the Lucid Lynx

  • 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-01T01:33:12+00:00Added an answer on June 1, 2026 at 1:33 am

    I’ve no answer to the why question, but here’s how to get rid of it: In your code snippet, giving scatter three points to draw

    plt.scatter([1.0,2,3], [1.1,2.2,2.9], s=20, color='tomato')
    

    works for me (matplotlib 1.1.0 on Lucid).

    I can only guess that scatter tries to be a bit smarter than plot with the axes limits,
    but whatever it’s doing, it goes nuts for just a single point.

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

Sidebar

Related Questions

I'm trying to put div elements right next to each other. The problem is,
I am trying to put a logo between two menu lists, but it isnt
Im trying to put in two sign up forms on a single page, but
I'm trying to put two sliders in the same form ; but I can't
I'm trying to take one group and put it in two different columns. I
Simply put I'm trying to sync two slideshows created using widgetkit lib in a
I am trying to put two .animate() in my main animate() callback. Not working?
I'm trying to put two buttons on the screen and set them up so
I'm trying to put two buttons inside a panel using Swing widgets. Inside the
I'm trying to put two pictures in the QGraphicsScene . One is fixed and

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.