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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:00:21+00:00 2026-05-26T19:00:21+00:00

Trying to plot a signal function of 0 and 1, much like the solution

  • 0

Trying to plot a signal function of 0 and 1, much like the solution given to the question below:
How to plot non-numeric data in Matplotlib

However, I’d like to have vertical lines instead of bent ones when the function goes from 0 to 1. So for instance if f(x)=0 for x = 1 2 3 4 and f(x) = 1 thereafter, I’d like a horizontal line at y=0 up to x=5, and a vertical line at x=5 going from y=0 to y=1, and then a horizontal line at y=1 thereafter

Can this be done within the plot function? Or do I need to draw a ton of squares?

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-05-26T19:00:22+00:00Added an answer on May 26, 2026 at 7:00 pm

    Have you tried the stairs function?

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

Sidebar

Related Questions

I'm trying to plot heatmap in ggplot2 using csv data following casbon's solution in
I'm trying to plot out GPS data that is given to me in Hour
I am trying plot data sets consisting of 3 coordinates: X-coordinate, x-coordinate and the
I have the following data set that I am trying to plot with ggplot2,
I'm trying to annotate a polar plot with data tips labelled with 'R:...,Theta:...' where
I have a plot (sample code pasted below) that I am trying to add
I am trying to plot side by side the following datasets dataset1=data.frame(obs=runif(20,min=1,max=10)) dataset2=data.frame(obs=runif(20,min=1,max=20)) dataset3=data.frame(obs=runif(20,min=5,max=10))
I'm trying to plot two sets of data wrt to time on the same
I'm currently trying to use the core-plot library to graph some data I get
I am trying to plot a bunch of data points (many thousands) in Python

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.