Visualization in Python is Matplotlib, but the difficulty is that the API is cluttered and difficult to remember. I feel that Bokeh is the most convenient because the API is well organized, but it is regrettable that there is still little information in Japanese. I'm hoping that Bokeh, which can support the Web, will grow in the future.
--If you want to plot simple data quickly - Matplotlib --If you switch from MATLAB to Python - Matplotlib ――If you want to look cool - Bokeh --If you want to include interactive operations - Bokeh --If you want to check the numerical value of the data points on the graph - Bokeh - Plotly --If you want to plot a 3D shape - Plotly - Mayavi --For statistical analysis - seaborn
Matplotlib
――It's easy to plot simple data. --The plot function is substantial (I feel). --There is more information in Japanese than others. --You can plot directly from pandas' DataFrame.plot method. - Visualization - API Reference - Series - Plotting - API Reference - DataFrame - Plotting --Since the API is similar to MATLAB, it is easy to switch from MATLAB. --The scale of the 3D plot is automatically set for each axis.
--Japanese cannot be displayed by default.
-You cannot move the graph interactively on the Notebook. (If you use % matplotlib notebook
instead of% matplotlib inline
, it will work, but if you close and reopen the notebook, it will not work.)
--A mixture of imperative APIs and object-oriented APIs can be confusing.
--The response of the interactive operation is not good.
--The 3D plotting procedure is cumbersome and difficult to remember.
――It is quite troublesome to align the scale of 3 axes in 3D plot, so it is not suitable for displaying 3D shape.
Bokeh
-You can move the graph interactively after plotting even on Notebook. --You can convert graphs that can be moved interactively into HTML and pass them on to people. - Embedding Plots and Apps --Easy to customize interactive operation - Configuring Plot Tools - Adding Widgets --Can be embedded in a website. - Running a Bokeh Server --You can dynamically update the graph with streaming data. - Updating From Threads --If you enable WebGL, you can move with good response even if you plot a large amount of data. - Speeding up with WebGL --Documents are easy to read.
--I can't plot in 3D. --The API of the basic plotting module has to be color-coded by yourself. --The API of the charts module is roundabout to plot simple data.
Plotly
-You can move the graph interactively after plotting even on Notebook. --You can convert graphs that can be moved interactively into HTML and pass them on to people. --The function to display the numerical value of the data point is enabled by default. ――3D plotting can be done in the same procedure as 2D plotting. --The response of the 3D plot is good. --Since the scale of the 3D plot is the same for all three axes, it is suitable for displaying 3D shapes.
Other features are similar to Bokeh, but I haven't looked into them in detail.
--It is troublesome to specify the size of the graph. --I don't know how to display a 3D plot on a different scale for each axis. --There is very little information. --Some functions are charged (Streaming seems to be charged) --Documents are hard to see. --The explanation of docstring is short. --Most of the sample code uses the paid version of the API. --Cannot search in official documents.
If you replace ʻimport plotly.plotly as py with ʻimport plotly.offline as py
, it should work.
Mayavi
--Since it is exclusively for 3D plotting, it has a full range of 3D plotting functions. --You can change the settings after plotting. --There is a Japanese tutorial on 3D plotting. -3.5. 3D plot by Mayavi — Scipy lecture notes
--Installation is troublesome because it does not support PyQt5
--It does not work by default in the root environment of Anaconda 4.3.0.
--You need to specify the version and install PyQt4.
--conda update --all
is NG (updated to PyQt5)
--By default, the axes are not displayed.
-Although it can be displayed on the Notebook, its functions are quite limited.
seaborn
--There are many ultra-high level APIs that specialize in statistical analysis --lmplot: Regression and plot at once - seaborn.lmplot --joinplot: A combination of a two-variable scatter plot and a histogram - seaborn.jointplot --pairplot: Collecting multivariable scatter plots - seaborn.pairplot --Jitter is convenient (a function to plot overlapping points that are difficult to see with a slight shift) --Jitter example: seaborn.stripplot
--The style of Matplotlib is changed without permission just by importing.
Jupyter-notebook drawing library comparison-Qiita Cheat sheet for displaying anything on Jupyter Notebook --Qiita
Recommended Posts