7

I've created the following plot with hvplot and want to rotate the xlabels in this plot:

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

my_plot = pd.DataFrame(np.random.normal(size=[50, 2])).hvplot()

rotate xlabel hvplot question

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

1 Answers1

10

This can be done in 2 ways:

1) By adding it as argument of .hvplot(rot=90)

my_plot = pd.DataFrame(np.random.normal(size=[50, 2])).hvplot(rot=90)

2) By using .opts(xrotation=90), if you would like to rotate the labels by 90 degrees.
For y labels you can use option yrotation=90.

my_plot = pd.DataFrame(np.random.normal(size=[50, 2])).hvplot()
my_plot.opts(xrotation=90)

hvplot xlabels rotated 90 degrees

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