RJL
RJL

Reputation: 351

How to put Bokeh legend on the 'bottom_right'

I am trying to produce an ROC curve using Bokeh. I have the following code that used to run before, but now I get an error saying: ValueError: invalid value: 'bottom_right'; allowed values are horizontal or vertical

p = figure(title='ROC Curve: Logistic Regression', width=800, height=800)

p.line(x=fpr, y=tpr, legend='ROC Curve: Area Under Curve = %0.3f' %roc_auc)
p.legend.orientation = 'bottom_right'
p.xaxis.axis_label = 'False Positive Rate'
p.yaxis.axis_label = 'True Positive Rate'
show(p)

All I want to do is to put the legend at the bottom of the screen so it won't cover part of the curve. Can anyone advise please? Thanks.

Upvotes: 2

Views: 3297

Answers (1)

bigreddot
bigreddot

Reputation: 34568

You want to set location, not orientation

p.legend.location = 'bottom_right'

https://docs.bokeh.org/en/latest/docs/user_guide/styling.html#location

Upvotes: 3

Related Questions