Transforming visualization from Seaborn to Bokeh
Asked Answered
I

1

6

I want the similar visualization as shown below using Bokeh. As I am new to Bokeh , I might be wondering is there any code that is as concise as the below one using Seaborn ?

My main focus is how to write code for same visualization in Bokeh

dataset

data = pd.read_csv('http://www-bcf.usc.edu/~gareth/ISL/Advertising.csv',index_col = 0)

Plotting the dataset

import seaborn as sns  

sns.pairplot(data, x_vars = ['TV', 'Radio','Newspaper'], y_vars = ['Sales'],               
             size =7, aspect =.7, kind = 'reg')

Also the code in Seaborn doesn't require to enter the best fitted line . It automatically generates the best fitted line in the graph with a shadow of confidence interval . Is this kind of plotting possible in Bokeh ?

enter image description here

Indeed answered 18/9, 2016 at 12:45 Comment(0)
T
4

The above charts are certainly possible with Bokeh, in the sense that Bokeh could draw them, without any question. But it would take some work, and require more code, than with Seaborn. Basically you'd have to compute all the coordinates and set up all the glyphs "by hand". As of Bokeh 0.12.2, there is not currently any comparable "single line" high level function or chart in bokeh.charts.

Adding more high level chart types lie this to bokeh.charts is definitely something that we'd like, but it will probably require motivated new contributors to make that happen. Fortunately, this area of Bokeh is pure-python and probably the most approachable for new contributors. If you are possibly interested in contributing to Bokeh, I encourage you to reach out on the public mailing list or gitter chat channel. We are always happy to answer questions and help people get started.

Tirza answered 18/9, 2016 at 21:17 Comment(3)
will definitely try to contribute to the given groups.Indeed
Is this possible as of March 2017?Glyphography
The answer above is unchanged. Those plots could be produced with the bokeh.plotting API but there is no single high level chart that will do it all in one line. (i.e. you draw the scatter, CI band, and line yourself)Tirza

© 2022 - 2024 — McMap. All rights reserved.