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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:38:49+00:00 2026-06-04T18:38:49+00:00

I am having trouble finishing a plot in matplotlib. Here is the code: arrays_k,

  • 0

I am having trouble finishing a plot in matplotlib. Here is the code:

arrays_k, arrays_v = splitbyrecordcount(ycsb[2])
checktype = [ "Update", "Read", "Verification" ]

fig = plt.figure()
ax = fig.add_subplot('111', projection='3d')

for z in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]:
    xs = arrays_k[z]
    ys = arrays_v[z]
    c = colmap.spectral(z/10.,1)
    ax.plot(xs, ys, zs=z, zdir='z', color=c)

It produces this:

Correct but wrong way round

I want the time plot how you might expect: more “in the plane” of the screen as opposed to sort of “perpendicular” to it as in the image above. I have tried lots of different combinations of the ax.plot() part, but if I change it to:

ax.plot(xs, ys, zs=z, zdir='y', color=c)

I get this:

what

Changing it to:

ax.plot(xs, ys, zs=z, zdir='x', color=c)

…doesn’t help either. It just makes a thin bar of everything in the z direction at the origin.

Any ideas? Even if someone knows a way to just rotate the whole graph so the plots are in the plane of the screen would be better than nothing.

  • 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-04T18:38:51+00:00Added an answer on June 4, 2026 at 6:38 pm

    Without having the data to check I believe the issue is the order of the arguments for ax.plot. Try this:

    ax.plot(xs, z * np.ones(xs.shape), zs=ys, zdir='z', color=c)
    

    So, you want what would be your ‘y’ axis in a 2D plot to be the height, hence zs=ys.

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

Sidebar

Related Questions

Having trouble with the following segment of code. I'm getting a parameter count mismatch.
Having trouble where I think I need to provide most of my code to
Having trouble with this code, wondering if I'm trying to achieve something impossible. I'm
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the
Having trouble finding a solution for my situation here. Sorry if this has been
Having trouble getting one portion of my code to work. Building a rudimentary linked
Having trouble converting the following code from dealing with IDs to Classes. Basicly what
Having trouble getting my form to UPDATE records in my database even after searching
I am having trouble finishing this javascript to convert coffee prices.. <html> <head> <title>Coffee
Having trouble accessing javascript code in a mixed html/js ajax response. jQuery ajax doc

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.