HoloViews is a wrapper that makes it easier to use visualization tools such as matplotlib and Bokeh in broken terms. Visualization can be implemented with unified code and simple description using any backend (matplotlib, Bokeh, etc.).
The learning cost of visualization is not very high, so by using HoloViews ** "Let's concentrate on the original data analysis and other tasks instead of wasting time writing visualization code" ** It seems to be a feeling concept. In particular, the syntax of matplotlib is often esoteric, so many people may be wondering, "Isn't it a little simpler?"
The following visualization tools can be used as a backend.
conda install -c ioam holoviews bokeh
If you use matplotlib or plotly for the backend described later, install it additionally.
conda install matplotlib plotly
[2017/07/30 postscript] There seem to be some Options (http://holoviews.org/user_guide/Installing_and_Configuring.html), but try installing with'recommended'.
pip install numpy param
pip install 'holoviews[recommended]'
Install the package used for the backend. There is no problem if you exclude unused items from the installation target.
pip install matplotlib bokeh plotly
What is git? Those who say it is better to install with the above conda or pip.
git clone git://github.com/ioam/holoviews.git
cd holoviews
pip install -e .
If the notebook version is 5.0, set the following startup options.
jupyter notebook --NotebookApp.iopub_data_rate_limit=100000000
In later versions, just jupyter notebook
seems to be fine.
Specify the backend as an argument of the notebook_extension
class.
import holoviews as hv
hv.extension('matplotlib')
When running on Jupyter Notebook, it can be set with cell magic.
%%output backend='matplotlib'
The following are all execution examples on Jupyter Notebook. matplotlib
import holoviews as hv
hv.extension('matplotlib')
curve = hv.Curve(([1, 2, 3], [1, 2, 4]))
curve
Bokeh
hv.extension('bokeh')
curve = hv.Curve(([1, 2, 3], [1, 2, 4]))
curve
Plotly
hv.extension('plotly')
curve = hv.Curve(([1, 2, 3], [1, 2, 4]))
curve
I was able to write the same code with any backend.
compose
I think many people say that arranging multiple figures with matplotlib was quite difficult. HoloViews allows you to arrange and overlay graphs simply by using operators.
hv.extension('bokeh')
curve = hv.Curve(([1, 2, 3], [1, 2, 4]))
bars = hv.Bars((['a', 'b', 'c'], [3, 2, 1]))
curve + bars
%%opts Scatter(color='green', size=10)
scatter = hv.Scatter(([1, 2, 3], [1, 2, 4]))
curve * scatter
curve * scatter + bars
HoloViews has various functions. If I have a chance, I would like to introduce them one by one.
-> Continued: Basic graph of HoloViews in one liner
Recommended Posts