Graph drawing with jupyter (ipython notebook) + matplotlib + vagrant

environment

Related article

python (pyenv) installation memo

Build Jupyter Lab environment with Docker

-Build Jupyter Lab with Docker

When building an environment with Vagrant

install matplotlib

$ pip install matplotlib

install jupyter

$ pip install jupyter

Port forwarding settings with vagrant ssh

Port forwarding to access jupyter on vagrant from a PC browser.

$ vagrant ssh -- -L 8888:localhost:8888

Or add the following to the Vagrantfile

Vagrantfile


Vagrant.configure("2") do |config|
  # *snip*
  config.vm.network "forwarded_port", guest: 8888, host: 8888
  # *snip*
end

Start jupyter

--ip = 0.0.0.0 is required when accessing other than localhost.

$ jupyter notebook --no-browser --ip=0.0.0.0

Or

$ ipython notebook --no-browser --ip=0.0.0.0

Access jupyter-notebook from your browser

http://localhost:8888 Or access with vagrant's IP address http://192.168.33.10:8888

Follow the pull-down menu on the upper right as follows New -> Python 3 581d5c.png Run sample code

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

x = np.arange(-3, 3, 0.1)
y = np.sin(x)
plt.plot(x, y)

9bd360.png

See here if you get an error related to No module named _tkinter or tkinter [If you use matplotlib, install the following first](http://qiita.com/Esfahan/items/0dfe70357549f92b23da#matplotlib%E4%BD%BF%E3%81%86%E3%81%AA%E3%82%89 % E4% B8% 8B% E8% A8% 98% E3% 82% 82% E5% 85% 88% E3% 81% AB% E3% 82% A4% E3% 83% B3% E3% 82% B9% E3 % 83% 88% E3% 83% BC% E3% 83% AB)

that's all

[reference] The story of building an ipython notebook environment with vagrant Launch ipython notebook with VM created with vagrant and access it locally What to do when the graph does not appear in the jupyter (ipython) notebook

Recommended Posts

Graph drawing with jupyter (ipython notebook) + matplotlib + vagrant
Graph drawing with IPython Notebook
Graph drawing method with matplotlib
EC2 provisioning with Vagrant + Jupyter (IPython Notebook) on Docker
Use apache Spark with jupyter notebook (IPython notebook)
[Jupyter Notebook memo] Display kanji with matplotlib
Rich cell output with Jupyter Notebook (IPython)
Install matplotlib and display graph on Jupyter Notebook
How to debug with Jupyter or iPython Notebook
Graph drawing using matplotlib
Drawing a tree structure with D3.js in Jupyter Notebook
Graph Excel data with matplotlib (1)
Using Graphviz with Jupyter Notebook
Use pip with Jupyter Notebook
Use Cython with Jupyter Notebook
Graph Excel data with matplotlib (2)
Run Apache-Spark with IPython Notebook
Use Bokeh with IPython Notebook
Write charts in real time with Matplotlib on Jupyter notebook
Allow external connections with jupyter notebook
R & D life with iPython notebook
Formatting with autopep8 on Jupyter notebook
Visualize decision trees with jupyter notebook
Make a sound with Jupyter notebook
Draw a loose graph with matplotlib
Use markdown with jupyter notebook (with shortcut)
Add more kernels with Jupyter Notebook
Build IPython Notebook environment with boot2docker
Convenient analysis with Pandas + Jupyter notebook
Jupyter does not show matplotlib graph
Use nb extensions with Anaconda's Jupyter notebook
Jupyter Notebook does not show matplotlib graphs
I want to blog with Jupyter Notebook
Try drawing a normal distribution with matplotlib
Use Jupyter Lab and Jupyter Notebook with EC2
Try SVM with scikit-learn on Jupyter Notebook
ipython + jupyter + plotly (matplotlib) settings & usage notes
How to use jupyter notebook with ABCI
Linking python and JavaScript with jupyter notebook
"LIVE" HTML presentation with IPython 3.0.0-dev, IPython Notebook
Graph trigonometric functions with numpy and matplotlib
Draw a graph with PyQtGraph Part 1-Drawing
Create a graph with borders removed with matplotlib
What to do when the graph does not appear in jupyter (ipython) notebook
R environment construction with Jupyter (formerly IPython notebook) (on OS X El Capitan 10.11.3)
Draw a flat surface with a matplotlib 3d graph
When Html cannot be output with Jupyter Notebook
Draw a graph with Japanese labels in Jupyter
Analytical environment construction with Docker (jupyter notebook + PostgreSQL)
Data analysis for improving POG 2 ~ Analysis with jupyter notebook ~
[Python] limit axis of 3D graph with Matplotlib
Read Python csv data with Pandas ⇒ Graph with Matplotlib
Drawing tips with matplotlib on the server side
Increase the font size of the graph with matplotlib
Enable Jupyter Notebook with conda on remote server
Try using conda virtual environment with Jupyter Notebook
Simply display a line graph on Jupyter Notebook
Fill the browser with the width of Jupyter Notebook
Draw a graph with matplotlib from a csv file
The basis of graph theory with matplotlib animation
Align Matplotlib graph colors with similar colors (color map)