Python ProgrammingPython Programming

Boxplot adjust bottom and left

Adjust bottom and left

import matplotlib.pyplot as plt
import pandas as pd

x = [[1.2, 2.3, 3.0, 4.5],
     [1.1, 2.2, 2.9, 5.0]]

df = pd.DataFrame(x, index=['Apple', 'Orange'])
df.T.boxplot()

plt.subplots_adjust(bottom=0.25)

plt.show()


Adjust bottom in boxplot
import matplotlib.pyplot as plt
import pandas as pd

x = [[1.2, 2.3, 3.0, 4.5],
     [1.1, 2.2, 2.9, 5.0]]

df = pd.DataFrame(x, index=['Apple', 'Orange'])

df.T.boxplot(vert=False)
plt.subplots_adjust(left=0.25)

plt.show()

Adjust left in boxplot