Skip to content

Commit aae1536

Browse files
committed
Re-order matplotlib.use() calls (before plt import)
Addressing warning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time.
1 parent 67c5622 commit aae1536

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

plasma/models/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from hyperopt import hp, STATUS_OK
1111
import numpy as np
1212
import sys
13-
import matplotlib.pyplot as plt
1413
import matplotlib
1514
matplotlib.use('Agg')
15+
import matplotlib.pyplot as plt
1616

1717
# if sys.version_info[0] < 3:
1818
# from itertools import imap

plasma/models/shallow_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
import datetime
2121
import time
2222
import numpy as np
23-
# import matplotlib.pyplot as plt
2423
import matplotlib
2524
matplotlib.use('Agg')
25+
# import matplotlib.pyplot as plt
2626

2727
# import sys
2828
# if sys.version_info[0] < 3:

plasma/utils/performance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import numpy as np
66
from pprint import pprint
77
import os
8-
import matplotlib.pyplot as plt
9-
from matplotlib import rc
108
import matplotlib
119
matplotlib.use('Agg') # for machines that don't have a display
10+
import matplotlib.pyplot as plt
11+
from matplotlib import rc
1212
rc('font', **{'family': 'serif', 'sans-serif': ['Times']})
1313
rc('text', usetex=True)
1414

0 commit comments

Comments
 (0)