我一直试图在Azure Jupiter笔记本中进行简单的可视化,但是每次执行matplotlib函数时,内核都会崩溃。我正在使用pyspark3内核。
这是导致解释器崩溃的代码行。
subroutine iterate_e_ring(i, k)
use otherfile, only: other_subroutine;
implicit none
integer(I2B), intent(in) :: i, k ! element number and iteration counter
real(BW), dimension(3) :: converge !Convergence check by Ole Müller
character*150 :: filename
call other_subroutine(x,y,z)
converge(1)= ...
converge(2)= ...
converge(3)= ...
open(unit=120,file='converge.txt',action='write',position="append")
write(120, *) real(converge(:))
close(unit=120)
end subroutine iterate_e_ring;
任何想法,如何在Azure服务器上启用绘图功能?
==编辑===
如果我使用建议的魔术,则在第一个单元格中会看到以下错误:
from pyspark import SparkContext
import pyspark.sql.functions as f
import itertools
import pandas as pd
import numpy as np
import math
import matplotlib.pyplot as plt
%matplotlib inline
plt.hist([1,2,3])
然后执行 plt.hist()会引发以下异常:
unknown magic command 'matplotlib'
UnknownMagic: unknown magic command 'matplotlib'