ipython and jupyter-console have different matplotlib backends. Due to this I can't show my plots when using jupyter-console.
Both run in virtual environment on Xubuntu 16.04.

[edit]
Where is ipython/jupyter config file located inside virtual environment created using
python -m venv myvenv?
I know that system-wide configuration file is something like
/.ipython/profile_default/ipython_kernel_config.py, and I can create it running
ipython profile create. But the ipython virtual enviroment-wide configuration file? Do I even need it, isn't changing system-wide config enough?

$ ipython
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import matplotlib

In [2]: matplotlib.get_backend()
Out[2]: 'TkAgg'



$ jupyter-console
Jupyter console 5.2.0

Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.


In [1]: import matplotlib

In [2]: matplotlib.get_backend()
Out[2]: 'module://ipykernel.pylab.backend_inline'
2

There are 2 best solutions below

0
On

In Jupyter notebook/console, you can set the back end like this:

import matplotlib
matplotlib.use('TkAgg')

You must do this upon starting the kernel i/e, if you've already run a matplotlib script, restart the kernel, and set the backend first by running the above code in a cell.

0
On

Go to your root folder.

cd ~

ls -la

you will see a .jupyter folder

cd .jupyter

you can see jupyter_notebook_config.py