1
2 """Plots a collection of timelines"""
3
4 from PyFoam.Error import warning,error
5
6 from .MatplotlibTimelines import MatplotlibTimelines
7
9 """This class opens a matplotlib window, modifies it to XKCD-mode and plots a timelines-collection in it"""
10
11 - def __init__(self,
12 timelines,
13 custom,
14 showWindow=True,
15 registry=None):
16 """@param timelines: The timelines object
17 @type timelines: TimeLineCollection
18 @param custom: A CustomplotInfo-object. Values in this object usually override the
19 other options
20 """
21
22 MatplotlibTimelines.__init__(self,
23 timelines,
24 custom,
25 showWindow=showWindow,
26 registry=registry
27 )
28
29 from matplotlib import pyplot
30 try:
31 pyplot.xkcd()
32 except AttributeError:
33 from matplotlib import __version__
34 warning("Installed version",__version__,
35 " of Matplotlib does not support XKCD-mode (this is supported starting with version 1.3). Falling back to normal operations")
36
37