Using python and matplotlib on android

后端 未结 12 1280
时光说笑
时光说笑 2020-12-13 14:10

Is there a way to set up python 2.7.x + matplotlib on an android tablet so that you can run simple standard python code? I would like to be able to run the same scripts I ru

12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 14:27

    Here is the code, this works after installing GNURoot Debian as you said. Just a detail : my graph is exported directly in a .png file :

    from pylab import *
    import matplotlib.pyplot as plt
    plt.switch_backend('agg')
    x = linspace(-5, 5, 100)
    y = sin(x)
    plot(x, y)
    out_png = 'out_file.png'
    plt.savefig(out_png, dpi=150)
    

提交回复
热议问题