Generating Inline Plots with Matplotlib Using Terminology (EFL by enlightenment.org)

55 Views Asked by At

Hello I have been trying to generate inline plots with matplotlib inside a terminal emulator called Terminology which can be found at:

https://www.enlightenment.org/about-terminology.md

This terminal emulator is able to display inline images using its own specific commands. Specifically, when inside the emulator, rather than use

ls

to list files in a directory it is possible to use the Terminology-specific command

tyls

to list the files and they then become interactive, for example you can click on them and they open in a pop-up.

Also entering the command

tycat *filename.png*

will open the image file inline.

I know that jupyter-qtconsole can easily generate the inline figures I desire however I quite enjoy the Terminology emulator.

My current understanding is that jupyter-console can generate inline figures by setting

%matplotlib inline

inside a console which supports inline image display. However when I try this it continues to generate an external figure instead.

Specifically, if I open up Terminology and run

jupyter-console

then enter the following python commands I generate an external figure in the standard interactive window.

In [1]: from numpy import *

In [2]: from matplotlib.pyplot import *

In [3]: x = arange(0,11,1)

In [4]: y = x**2

In [5]: plot(x,y,'r--')

Out[5]: [<matplotlib.lines.Line2D at 0x7f0591d98ee0>]

The output of

%matplotlib

is

Using matplotlib backend: Qt5Agg

When I try to change to inline using

%matplotlib inline

Then check

%matplotlib

again it still returns

Using matplotlib backend: Qt5Agg

Trying to plot again it once again opens a figure in another window, however, interestingly it switches the application to imagemagick to view the figure.

I can cycle these commands and the externally generated figure will continue to change between the interactive window and imagemagick.

If I had a better understanding of what I was doing I would try to get the jupyter-console %matplotlib inline command to link up with the Terminology inline image display functionality somehow. Unfortunately this is the point where I get stuck. Any suggestions or tips would be very welcome.

My OS is Arch Linux 5.4.79-1-lts with KDE plasmashell 5.20.3 Qt: 5.15.2 KDE Frameworks: 5.76.0.

0

There are 0 best solutions below