HoloViews may become the standard for Python visualization tools

What is HoloViews

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?"

Back end

The following visualization tools can be used as a backend.

Installation

When installing with conda

conda install -c ioam holoviews bokeh

If you use matplotlib or plotly for the backend described later, install it additionally.

conda install matplotlib plotly

When installing with pip

[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

When installing the latest version

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 .

Jupyter Notebook launch options

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.

Backend settings

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'

Try to output the graph

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

image.png

Bokeh

hv.extension('bokeh')
curve = hv.Curve(([1, 2, 3], [1, 2, 4]))
curve

image.png

Plotly

hv.extension('plotly')
curve = hv.Curve(([1, 2, 3], [1, 2, 4]))
curve

kako-N8G5ENNJ89pITG0B.png

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.

Arrange with + operator

hv.extension('bokeh')
curve = hv.Curve(([1, 2, 3], [1, 2, 4]))
bars = hv.Bars((['a', 'b', 'c'], [3, 2, 1]))
curve + bars

image.png

* Overlap with operators

%%opts Scatter(color='green', size=10)
scatter = hv.Scatter(([1, 2, 3], [1, 2, 4]))
curve * scatter

image.png

Combine + and * operators

curve * scatter + bars

image.png

Features of HoloViews

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

HoloViews may become the standard for Python visualization tools
Various Python visualization tools
Refactoring tools for Python
Python3 standard input for competitive programming
[Python] Adjusted the color map standard
The story of making a standard driver for db with python.
Python development environment options for May 2020
See python for the first time
What is the python underscore (_) for?
Become the next higher Python user
Command for the current directory Python
[Python] I examined the exe conversion method for distributing business efficiency tools.
Introducing the BOT framework Minette for Python
Python visualization tool for data analysis work
Python Master RTA for the time being
Launch the Discord Python bot for 24 hours.
Let's summarize the Python coding standard PEP8 (1)
MongoDB for the first time in Python
Pandas of the beginner, by the beginner, for the beginner [Python]
Let's summarize the Python coding standard PEP8 (2)
Python Tools for Visual Studio Installation Guide
Tips for making small tools in python
From Python 3.4, pip becomes the standard installer! ??
Atcoder standard input set for beginners (python)
I searched for the skills needed to become a web engineer in Python
CERTIFICATE_VERIFY_FAILED in Python 3.6, the official installer for macOS
The fastest way for beginners to master Python
[Python] I tried substituting the function name for the function name
The story of low learning costs for Python
vprof --I tried using the profiler for Python
[Python] matplotlib: Format the diagram for your dissertation
Wagtail is the best CMS for Python! (Perhaps)
Upgrade the Azure Machine Learning SDK for Python
Use logger with Python for the time being
I tried python programming for the first time.
Tips for hitting the ATND API in Python
Python: Prepare a serializer for the class instance:
[Python] I searched for the longest Pokemon Shiritori
Image processing? The story of starting Python for
Django with Python Tools 2.2 for Visual Studio (PTVS 2.2)
[Python] Predict the appropriate rent for an apartment
Code for checking the operation of Python Matplotlib
Call Polly from the AWS SDK for Python
Things to keep in mind when building automation tools for the manufacturing floor in Python