[PYTHON] How to avoid writing% matplotlib inline every time

Introduction

I use jupyter notebook every time``` %matplotlib inline

 I wrote,
 I thought that if you use it all the time, you should set it first.
 The real motivation is when you want to use .ipynb as .py
 I get a get_ipython error, so I used this method as a way to avoid it.

# Solution

 Display matplotlib graph

```py
%matplotlib inline

Is automatically enabled as follows.

Set the notebook profile. If you have not set it, create it with the following command.

ipython profile create

Edit the resulting ~ / .ipython / profile_default / ipython_config.py.

# lines of code to run at IPython startup.
# c.InteractiveShellApp.exec_lines = traitlets.Undefined
c.InteractiveShellApp.exec_lines = ['%matplotlib inline']

c.InteractiveShellApp.exec_lines = ['%matplotlib inline']Add a line for.


 After that, if you start notebook as usual, `` `% matplotlib inline``` will be enabled automatically.


Recommended Posts

How to avoid writing% matplotlib inline every time
How to use Matplotlib
How to run matplotlib on heroku
How to title multiple figures with matplotlib
How to suppress display error in matplotlib
How to compare time series data-Derivative DTW, DTW-
How to draw a graph using Matplotlib
How to set the server time to Japanese time
matplotlib Write text to time series graph
How to handle time series data (implementation)
How to assign multiple values to the Matplotlib colorbar
How to use MkDocs for the first time
How to achieve time wait processing with wxpython
[Python] How to draw multiple graphs with Matplotlib
How to measure execution time with Python Part 1
How to avoid BrokenPipeError with PyTorch's DataLoader Note
How to display images continuously with matplotlib Note
How to display videos inline in Google Colab
How to read time series data in PyTorch
[Python] How to draw a histogram in Matplotlib
[wxpython] How to use wx.lib.plot basic & time axis
How to measure execution time with Python Part 2
How to avoid the cut-off label of the graph created by the plot module using matplotlib
How to apply markers only to specific data in matplotlib
I tried to summarize how to use matplotlib of python
[Python] How to draw a line graph with Matplotlib
How to measure processing time in Python or Java
How to measure mp3 file playback time with python
To avoid spending time coloring shapes drawn with python
How to eliminate garbled characters in matplotlib output image
How to add color bars in matplotlib bar plot
[Python] How to create a 2D histogram with Matplotlib
How to pass matplotlib backend settings in environment variables
I want to restart CentOS 8 on time every day.
[Python] How to draw a scatter plot with Matplotlib
How to start the PC at a fixed time every morning and execute the python program