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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:26:06+00:00 2026-06-01T11:26:06+00:00

— This is an updated post, old post removed — Suppose I have data

  • 0

— This is an updated post, old post removed —

Suppose I have data like below I want to plot in a 3D graph/surface with matplotlib. How can I do it?

enter image description here

Following @JouniK.Seppänen’s answer, I figured I need meshgrid(), but I think my axis data is not very correct. If I have data (in JSON) like:

{
    "data": {
        "Random": [
            [1834, 3353, 4602, 5471, 6522, 7873], 
            [2637, 8575, 8357, 10329, 9742, 10359], 
            [3648, 10602, 10667, 10751, 10666, 10552], 
            [4570, 10220, 9202, 10460, 10329, 10928], 
            [5879, 10788, 10832, 10923, 11075, 10989], 
            [6783, 11104, 10235, 10499, 11024, 10731], 
            [7074, 11097, 10222, 10613, 10508, 10767], 
            [7300, 11002, 10727, 11073, 10328, 10864]], 
        "LRU": [
            [123, 155, 201, 223, 296, 321], 
            [143, 590, 1046, 1566, 1924, 2434], 
            [163, 1167, 1774, 2578, 3363, 3980], 
            [182, 1172, 2259, 3038, 4200, 4907], 
            [219, 1718, 3044, 3658, 5236, 5680], 
            [709, 2263, 3588, 4551, 5262, 6197], 
            [2065, 3865, 4430, 5024, 5986, 6617], 
            [3048, 4249, 5029, 5790, 6157, 6826]], 
        "FIFO": [
            [180, 269, 350, 424, 580, 601], 
            [230, 906, 1446, 2009, 2408, 2902], 
            [316, 1590, 2261, 3042, 3848, 4457], 
            [473, 1664, 2781, 3542, 4764, 5398], 
            [665, 2290, 3609, 4194, 5781, 6207], 
            [1158, 2826, 4115, 5064, 5751, 6613], 
            [2457, 4375, 4974, 5471, 6464, 7077], 
            [3512, 4724, 5485, 6272, 6684, 7312]]
    }, 
    "workingSetAxis": [2, 22, 42, 62, 82, 102, 122, 142], 
    "stabilityAxis": [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
}

Where workingSetAxis is supposed to be the x-axis, and stabilityAxis the y-axis. I did something like

plot(jsonObj["data"]["FIFO"], jsonObj["workingSetAxis"], jsonObj["stabilityAxis"])

def plot(data, workingSetAxis, stabilityAxis):
    # make axis data
    X, Y = numpy.meshgrid(workingSetAxis, stabilityAxis)
    Z = data

    fig = plt.figure()
    ax = fig.add_subplot(111, projection="3d")
    ax.plot_wireframe(X, Y, Z)
    plt.show()

and got something like:

enter image description here

very different from the plot I got from excel (for FIFO data)

enter image description here

I believe my axis data or something is wrong, but which?

  • 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-01T11:26:07+00:00Added an answer on June 1, 2026 at 11:26 am

    Try plotting the transpose of your data, for example, using

    def plot(data, workingSetAxis, stabilityAxis):
        # make axis data
        X, Y = numpy.meshgrid(workingSetAxis, stabilityAxis)
        Z = numpy.transpose(data) #<--- This is the only line I have changed.
    
        fig = plt.figure()
        ax = fig.add_subplot(111, projection="3d")
        ax.plot_wireframe(X, Y, Z)
        plt.show()
    

    and your example data gives me the following plot:
    plot demonstrating expected output

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

Sidebar

Related Questions

I have set of xml elements like this: <item code=<HTML_CODE> /> For example: <items>
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
So to start, I have an array of XML files. These files need to
I'm trying to create a chrome extension and im doing this by parsing an
All of my code is on my SVN, but I want some of it
I basically have the classic many to many model. A user, an award, and
I'm currently working on a little harvester, using this dataset of 2700 foundations .
By fixed vector I mean a static list of values, like 1 through 24.
&mdash; or &#8212; Is there a difference between these? Is one better-supported than the
Any idea whats the difference between the two commands below? Command: manage.py runfcgi method=threaded

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.