I am wondering how I can pass matplotlibs where = "post" to the pandas chart.
import numpy as np import pandas as pd df = pd.DataFrame(np.random.randn(36, 3)) df.plot(drawstyle="steps", linewidth=2) # this doesn't work df.plot(drawstyle="steps", where='post')
Does anyone know how to implement this?
Thanks in advance!
You just need to specify drawstyle="steps-post":
drawstyle="steps-post"
df = pd.DataFrame(np.random.randn(36, 3)) df.plot(drawstyle="steps", linewidth=2) df.plot(drawstyle="steps-post", linewidth=2)
Compare the result:
Why not just use the matplotlib chart? Click here for an example.
from matplotlib import pyplot as plt plt.step(range(len(df.index)),df[0],where='post') plt.step(range(len(df.index)),df[1],where='post') plt.step(range(len(df.index)),df[2],where='post')
Source: https://habr.com/ru/post/1626403/More articles:AngularJS - $cancelRequest недоступен в $resource - angularjsWhy does an echo expression with undefined variables print 0? - phpПолучить URL-адреса разрешенных зависимостей с помощью gradle - javaParse.com/CloudCode Promises is not entirely clear - javascriptWhy can't my server lambda access the bucket and S3 items? - amazon-s3Parallelize a python numpy.searchsorted loop using cython - pythonMethod reference in Java unil BiFunction - javaMoviepy - Create multiple subclips using times from a CSV file - pythonImage storage? Database or file system in the cloud - databaseHow can I call a javascript function in the view of my ASP MVC application - c #All Articles