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

  • Home
  • SEARCH
  • 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 8648259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:16:21+00:00 2026-06-12T13:16:21+00:00

Hi I am trying to plot this using matplotlib’s step function from matplotlib.pyplot import

  • 0

Hi I am trying to plot this using matplotlib’s step function

from matplotlib.pyplot import step, show, xlim

time = [0.0, 0.0, 0.0, 25.3039, 25.5539, 25.8049, 45.8699, 46.1209, 46.3719, 46.6229, 63.1719, 63.4239, 63.6749, 79.9779, 80.2289, 80.4799, 80.7309]
value = ['0', '0', '0', '93', '940', '951', '940', '437', '422', '421', '423', '598', '605', '192', '3', '1', '0']

xlim(0, 145)
step(time,value)

show()

I am hoping the step function will show the plot to be 0 and starts at 93 from time 25.3039. Instead I see value 93 from time 0 as shown in the graph. I need to keep the timeline to start from 0 so I can’t really change my xlim to start from 25.3039

What should I do to fix the issue? Any help will be appreciated!

Thanks!

  • 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-12T13:16:22+00:00Added an answer on June 12, 2026 at 1:16 pm

    You need to set where step should step (doc). The default is that the locations are interpreted as the right edge, you want the locations interpreted as the left edge.

    step(time,value,where='post')
    

    See Step function in matplotlib for a longer explanation/example.

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

Sidebar

Related Questions

I'm trying to show a contour plot using matplotlib from a complex array. The
I get this horrible massive error when trying to plot using matplotlib: Traceback (most
I am trying to follow this tutorial ( Using-core-plot-in-an-iphone-application ). When I try to
I am trying to plot some test data (show at the end of this
I'm trying to plot a step chart with the following properties: x-axis: Time (ms)
I am trying to plot some data using pylab scatter function. I'm using pylab.scatter(X,
I'm trying to generate a 3D scatter plot using Matplotlib. I would like to
I am trying to make a contour plot of the following data using matplotlib
I'm trying to plot a graph in real time using GNUplot and C++. Does
I am trying to plot some HDF data in matplotlib. After importing them using

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.