Draw plot on a supercomputer using ipython

288
December 29, 2017, at 03:39 AM

I want to plot a figure using python on a supercomputer.

For example, I wrote a script plot.py:

import numpy as np
import matplotlib.pyplot as plt
....
....
plt.plot(m) # m is a matrix with size (1000,36) 
plt.show()

If I do:

python3 plot.py

there is no picture. But I can get all other numerical output. (I can get a figure with the same script on my mac with python3.6 but not at supercomputer)

But if I do:

ipython -i --matplotlib=tk -- plot.py 1 2 3 4

or

ipython -i --pylab=tk -- plot.py 1 2 3 4

The plot will show up.

I tried to delete "-i", and it seemed that "-i" is necessary. I don't understand the logic behind it. Why can we not use python3 directly on a supercomputer to plot? And why --matplotlib=tk or --pylab=tk all worked but deleting both of them will not work. And "1 2 3 4" is not necessary.

Could someone help to explain why "ipython -i" works on a supercomputer?

Rent Charter Buses Company
READ ALSO
Python numpy/scipy: get lognormal random number given log10 mean and log10 standard deviation

Python numpy/scipy: get lognormal random number given log10 mean and log10 standard deviation

I am given the log10 mean and log10 standard deviation of a log-normal distributionI want to get a random number from this log-normal distribution

321
Find, replace and print out updated string

Find, replace and print out updated string

I am trying to create a python script that has 10-20 lines of fixed data in a string with 2 special character's that need to be replaced with a different, random string using randomword()

301
How to scrape data from different sites with different source code with a single script?

How to scrape data from different sites with different source code with a single script?

I've written a script in python to parse different profile names available in different websitesEach link is connected to each individual in which their profile information are available

223
Transform Pandas DataFrame of categorical variables to MultiIndex with count and proportion

Transform Pandas DataFrame of categorical variables to MultiIndex with count and proportion

I have a Pandas DataFrame containing several categorical variablesFor example:

489