Skip to content

Commit

Permalink
bp-chart: now work on systems with no DISPLAY
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed May 5, 2017
1 parent e085e8a commit 778a7f9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions benchpress/visualizer/series_per_cmd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import matplotlib.pyplot as plt
import pylab
from benchpress.visualizer import util


Expand All @@ -14,6 +12,12 @@ def value_labels(ax, rects):


def line_per_cmd(args):
import matplotlib
if args.output is not None:
matplotlib.use('Agg') # We need this to make matplotlib work on systems with no DISPLAY
import matplotlib.pyplot as plt
import pylab

plt.style.use(args.pyplot_style)

# First we create `means` which map a command label and date to a pair of mean and standard deviation
Expand Down Expand Up @@ -129,7 +133,6 @@ def main():
'--pyplot-style',
default='seaborn-darkgrid',
type=str,
choices=plt.style.available,
help="The matplotlib.pyplot.style to use"
)
parser.add_argument(
Expand Down

0 comments on commit 778a7f9

Please sign in to comment.