Source
plt.xticks(ind + .6, [ p.name for p in data ], rotation=-60, rotation_mode="anchor", fontsize=8, ha='left')
#!/usr/bin/env python
# Copyright (C) 2011 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
# Copyright (C) 2013 by Yann E. MORIN <yann.morin.1998@free.fr>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# This script generates graphs of packages build time, from the timing
# data generated by Buildroot in the $(O)/build-time.log file.
#
# Example usage:
#
# cat $(O)/build-time.log | ./support/scripts/graph-build-time --type=histogram --output=foobar.pdf
#
# Three graph types are available :
#
# * histogram, which creates an histogram of the build time for each
# package, decomposed by each step (extract, patch, configure,
# etc.). The order in which the packages are shown is
# configurable: by package name, by build order, or by duration
# order. See the --order option.
#
# * pie-packages, which creates a pie chart of the build time of
# each package (without decomposition in steps). Packages that
# contributed to less than 1% of the overall build time are all
# grouped together in an "Other" entry.
#
# * pie-steps, which creates a pie chart of the time spent globally
# on each step (extract, patch, configure, etc...)
#
# The default is to generate an histogram ordered by package name.
#
# Requirements:
#
# * matplotlib (python-matplotlib on Debian/Ubuntu systems)
# * numpy (python-numpy on Debian/Ubuntu systems)
# * argparse (by default in Python 2.7, requires python-argparse if
# Python 2.6 is used)
import sys
try:
import matplotlib as mpl
import numpy
except ImportError:
sys.stderr.write("You need python-matplotlib and python-numpy to generate build graphs\n")
exit(1)
# Use the Agg backend (which produces a PNG output, see
# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
# otherwise an incorrect backend is used on some host machines).