Steven G
Steven G

Reputation: 17152

How to change marker size with pandas.plot()

I have a chart created from df.plot(style="o") where the o markers are too big. Would it be possible to size them down?

import pandas as pd
df = pd.DataFrame(range(1, 10))
df.plot(style="o")

plot where markers are too big

How can I shrink them down?

Upvotes: 25

Views: 37325

Answers (1)

Steven G
Steven G

Reputation: 17152

After investigation, it looks like that you can pass the ms, short for markersize (which also work) argument directly to pandas.plot() such has:

import pandas as pd
df = pd.DataFrame(range(1, 10))
df.plot(style="o", ms=3)

enter image description here

Upvotes: 41

Related Questions