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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:46:40+00:00 2026-06-18T10:46:40+00:00

All the examples I’ve been turning up use random data. My problem is arranging

  • 0

All the examples I’ve been turning up use random data. My problem is arranging my actual data to fit the solution.

I’m trying to create a heatmap/scatterplot of x,y,z: x and y are the position, whilst z is the color.
They’re in three arrays of equal length.

X = [-0.11, -0.06, -0.07, -0.12, ...]
Y = [0.09, 0.13, 0.17, 0.09, ...]
Z = [0.38, 0.37, 0.44, 0.33, ...]

The pcolormesh documentation doesn’t seem to describe what “C” is other than to say it can be a “masked array”. Sadly I don’t know what that is either (yet).

How do I turn my three arrays into whatever it’s looking for? I tried sticking them into a numpy array and passing that, which quieted the error about no “shape”, but a three dimensional array doesn’t seem to be what it’s looking for.

  • 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-18T10:46:41+00:00Added an answer on June 18, 2026 at 10:46 am

    pcolormesh wants three 2-D arrays.

    your X and Y are fine, but need to be run through numpy’s meshgrid function, i.e.:

    import numpy as np
    X = [-0.11, -0.06, -0.07, -0.12, ...]
    Y = [0.09, 0.13, 0.17, 0.09, ...]
    xx, yy = np.meshgrid(X, Y)
    

    then you just need to get Z to be in a shape that is the same as xx and yy and you’ll be all set.

    For the scatter plot, X, Y, and, Z are fine:

    import matplotlib.pyplot as plt
    X = [-0.11, -0.06, -0.07, -0.12, ...]
    Y = [0.09, 0.13, 0.17, 0.09, ...]
    Z = [0.38, 0.37, 0.44, 0.33, ...]
    fig, ax = plt.subplots()
    ax.scatter(X, Y, c=Z)
    plt.show()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using opengl and trying to create a first person camera. All examples use
I'm trying to create plugins for Umbraco 5. I see in all examples mention
I want to use CKEditor with DynamicData Web Site. The all examples that I
I am trying to find rectangle buttons with gloss effect. all examples are relevant
I'm trying to understand the equals() method better. All examples I've seen do something
I'm trying to map my Hashmap in Hibernate. All examples I can find are
All examples in Qt show that one should use delegate classes to provide editors
I started using .NET4.5 for async and await. All examples seem to use the
This problem has been solved before, but I'm just not getting it with examples
I have been reading up on the call stack lately. However all examples 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.