MikeB2019x
MikeB2019x

Reputation: 1205

holoviews how to set margin around a layout

Using holoviews with the plotly extension, I am rendering a layout with several overlay plots. Each plot has a 4 line title. Unfortunately, the result clips the title from 4 lines to two. It feels like I need to set margins but doing so does not seem to help. How can I make it so that all of the title shows?

This is a simplified example code with the result.

height = 500
width = 500

x = range(0,21)
y = [3.00 + 0.500*i for i in x]

data = pd.DataFrame(zip(x,y),columns=['x','y'])
lin_reg = hv.Scatter(data).opts(height=height, width=width
                                , color='red'
                                , marker='diamond', size=3
                               )


title = "Pearson={} <br>Spearman={} <br>Kendall={} <br>Xi={}".format(1, 2, 3, 4)
temp = hv.Scatter(data).opts(title=title, height=height, width=width
                            , margins=(10, 100, 10, 100))

final = temp * lin_reg

hv.Layout([final]).cols(1).opts(shared_axes=False, width=800)

enter image description here

Upvotes: 0

Views: 48

Answers (0)

Related Questions