Cor*_*yer 9 python matplotlib pandas
我想知道如何将matplotlibs ="post"传递到pandas图中.
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')
Run Code Online (Sandbox Code Playgroud)
有谁知道如何实现这一点?
提前致谢!
CT *_*Zhu 26
你只需要指定drawstyle="steps-post":
df = pd.DataFrame(np.random.randn(36, 3))
df.plot(drawstyle="steps", linewidth=2)
df.plot(drawstyle="steps-post", linewidth=2)
Run Code Online (Sandbox Code Playgroud)
比较结果: