Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 996
Steven G Avatar asked Dec 12 '16 18:12

Steven G


People also ask

How do I change the size of a figure in pandas plot?

The size of a plot can be modified by passing required dimensions as a tuple to the figsize parameter of the plot() method. it is used to determine the size of a figure object. Where dimensions should be given in inches.

How do I make a marker smaller in matplotlib?

Set the figure size and adjust the padding between and around the subplots. Create random data points, x. Plot x data points using plot() method, with linewidth =0.5 and color="black".


1 Answers

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

like image 176
Steven G Avatar answered Sep 20 '22 04:09

Steven G