displaying png in sage-8.1.ova VirtualBox notebook

asked 2019-03-09 09:49:43 +0200

ortollj gravatar image


As I encountered freeze and slowdown issues with the W10 upgrade version 1809 and the version generated by SageMath-8.6-Installer-v0.4.1.exe for W10, I got back to my sage-8.1.ova version with VirtualBox. but when I execute the code below, nothing happens !, no error message either. And the image does not appear.

import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
from matplotlib.pyplot import figure
figure(num=None, figsize=(20, 10), dpi=100, facecolor='w', edgecolor='k')
img = mpimg.imread(imgPath+"p375Ex7_6.png")
#img = mpimg.imread("p375Ex7_6.png")
imgplot = plt.imshow(img)

image description

edit retag flag offensive close merge delete


I forgot to precise the VirtualBox version VirtualBox Graphical User Interface Version 5.2.18 r124319 (Qt5.6.2) Copyright © 2018 Oracle Corporation and/or its affiliates. All rights reserved. I try this one too: VirtualBox Graphical User Interface Version 5.2.26 r128414 (Qt5.6.2) Copyright © 2019 Oracle Corporation and/or its affiliates. All rights reserved.

maybe something to do with this ? Centos png pb

ortollj gravatar imageortollj ( 2019-03-09 10:30:32 +0200 )edit

after connecting My VM to my network I tried to upgrade ImageMagik in a terminal windows su root: sudo yum update && sudo yum install ImageMagick but no change. Afterward I verified my png with the command in a terminal display p375Ex7_6.png and it was ok: what is wrong ? I do not understand why png is displayed in a SageMath notebook under W10 but not displayed in the Centos VM notebook !

ortollj gravatar imageortollj ( 2019-03-09 21:13:53 +0200 )edit

I tried this in a notebook cell:

import os

os.system("display /home/sage/Documents/p375Ex7_6.png")

but the image can be seen only the first time of the execution in the notebook ! Afterward impossible to see the image again.I can see it again if I reset the kernel.

ortollj gravatar imageortollj ( 2019-03-09 21:55:35 +0200 )edit