GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Installation
  • Documentation
  • Examples
  • Tutorials
  • Contributing

This view

  • Original page
  • New address

GeezerVison is showing matplotlib.org — matplotlib.pyplot.step — Matplotlib 3.1.2 documentation

You are reading an old version of the documentation (v3.1.1). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.step.html
Version 3.1.2
matplotlib
Fork me on GitHub

Navigation

  • index
  • modules |
  • next |
  • previous |
  • home| 
  • contents »
  • API Overview »
  • matplotlib.pyplot »
  • matplotlib.pyplot »

Quick search

Table of Contents

  • matplotlib.pyplot.step
    • Examples using matplotlib.pyplot.step

Related Topics

  • Documentation overview
    • API Overview
      • matplotlib.pyplot
        • matplotlib.pyplot
          • Previous: matplotlib.pyplot.stem
          • Next: matplotlib.pyplot.streamplot
Show Page Source

matplotlib.pyplot.step¶

matplotlib.pyplot.step(x, y, *args, where='pre', data=None, **kwargs)[source]¶

Make a step plot.

Call signatures:

step(x, y, [fmt], *, data=None, where='pre', **kwargs)
step(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs)

This is just a thin wrapper around plot which changes some formatting options. Most of the concepts and parameters of plot can be used here as well.

Parameters:
x : array_like

1-D sequence of x positions. It is assumed, but not checked, that it is uniformly increasing.

y : array_like

1-D sequence of y levels.

fmt : str, optional

A format string, e.g. 'g' for a green line. See plot for a more detailed description.

Note: While full format strings are accepted, it is recommended to only specify the color. Line styles are currently ignored (use the keyword argument linestyle instead). Markers are accepted and plotted on the given positions, however, this is a rarely needed feature for step plots.

data : indexable object, optional

An object with labelled data. If given, provide the label names to plot in x and y.

where : {'pre', 'post', 'mid'}, optional, default 'pre'

Define where the steps should be placed:

  • 'pre': The y value is continued constantly to the left from every x position, i.e. the interval (x[i-1], x[i]] has the value y[i].
  • 'post': The y value is continued constantly to the right from every x position, i.e. the interval [x[i], x[i+1]) has the value y[i].
  • 'mid': Steps occur half-way between the x positions.
Returns:
lines

A list of Line2D objects representing the plotted data.

Other Parameters:
**kwargs

Additional parameters are the same as those for plot.

Notes

Examples using matplotlib.pyplot.step¶

../../_images/sphx_glr_step_demo_thumb.png

Step Demo

© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2018 The Matplotlib development team.
Last updated on Jan 05, 2020. Created using Sphinx 1.8.5. Doc version v3.1.1-79-g90d53b526.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.