1

Hvplot plots default a vertical violinplot or boxplot. See example below.
How do I get this to be a horizontal plot? So basically I would like to rotate this plot.

import numpy as np
import pandas as pd
import hvplot
import hvplot.pandas

df = pd.DataFrame(np.random.normal(size=[100, 2]), columns=['col1', 'col2'])
plot_hvplot = df.hvplot(kind='box')

vertical boxplot

Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96

1 Answers1

2

You can do this by adding argument invert=True, like this:

plot_hvplot = df.hvplot(kind='box', invert=True)

or by using method .opts(invert_axes=True):

plot_hvplot = df.hvplot(kind='box').opts(invert_axes=True)

enter image description here

Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96