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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:22:58+00:00 2026-06-17T22:22:58+00:00

I create a pandas scatter-matrix usng the following code: import numpy as np import

  • 0

I create a pandas scatter-matrix usng the following code:

import numpy as np
import pandas as pd

a = np.random.normal(1, 3, 100)
b = np.random.normal(3, 1, 100)
c = np.random.normal(2, 2, 100)

df = pd.DataFrame({'A':a,'B':b,'C':c})
pd.scatter_matrix(df, diagonal='kde')

This result in the following scatter-matrix:
enter image description here

The first row has no ytick labels, the 3th column no xtick labels, the 3th item ‘C’ is not labeled.

Any idea how to complete this plot with the missing labels ?

  • 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-17T22:22:59+00:00Added an answer on June 17, 2026 at 10:22 pm

    Access the subplot in question and change its settings like so.

    axes = pd.scatter_matrix(df, diagonal='kde')
    ax = axes[2, 2] # your bottom-right subplot
    ax.xaxis.set_visible(True)
    draw()
    

    You can inspect how the scatter_matrix function goes about labeling at the link below. If you find yourself doing this over and over, consider copying the code into file and creating your own custom scatter_matrix function.

    https://github.com/pydata/pandas/blob/master/pandas/tools/plotting.py#L160

    Edit, in response to a rejected comment:

    The obvious extensions of this, doing ax[0, 0].xaxis.set_visible(True) and so forth, do not work. For some reason, scatter_matrix seems to set up ticks and labels for axes[2, 2] without making them visible, but it does not set up ticks and labels for the rest. If you decide that it is necessary to display ticks and labels on other subplots, you’ll have to dig deeper into the code linked above.

    Specifically, change the conditions on the if statements to:

    if i == 0
    if i == n-1
    if j == 0
    if j == n-1
    

    respectively. I haven’t tested that, but I think it will do the trick.

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

Sidebar

Related Questions

I'd like to create a pandas DataFrame from the following csv file: ........... EUR
I want to be able to create a Pandas DataFrame with MultiIndexes for the
I am using pandas.DataFrame in a multi-threaded code (actually a custom subclass of DataFrame
If I import or create a pandas column that contains no spaces, I can
I am trying to create a pandas DataFrame and it works fine for a
New to pandas python. I have a dataframe (df) with two columns of cusips.
When I create a DataFrame, then sort by a column it appears to be
I would like to write a subclass of pandas.core.index.Index . I'm following the guide
I am unable to create a dataframe which has escaped quotes when using read_csv
A simple example: import sqlite3, datetime, csv import pandas.io.sql as sql from dateutil.parser import

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.