Mercurial > hg > nsaunier > traffic-intelligence
comparison python/utils.py @ 990:94bee7b604eb
addition
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 09 Mar 2018 17:02:22 -0500 |
| parents | 184f1dd307f9 |
| children | 4f3387a242a1 |
comparison
equal
deleted
inserted
replaced
| 988:dc0be55e2bf5 | 990:94bee7b604eb |
|---|---|
| 882 | 882 |
| 883 linestyles = PlottingPropertyValues(['-', '--', '-.', ':']) | 883 linestyles = PlottingPropertyValues(['-', '--', '-.', ':']) |
| 884 | 884 |
| 885 colors = PlottingPropertyValues('brgmyck') # 'w' | 885 colors = PlottingPropertyValues('brgmyck') # 'w' |
| 886 | 886 |
| 887 def monochromeCycler(withMarker = False): | |
| 888 from cycler import cycler | |
| 889 if withMarker: | |
| 890 monochrome = (cycler('color', ['k']) * cycler('linestyle', ['-', '--', ':', '-.']) * cycler('marker', ['^',',', '.'])) | |
| 891 else: | |
| 892 monochrome = (cycler('color', ['k']) * cycler('linestyle', ['-', '--', ':', '-.'])) | |
| 893 plt.rc('axes', prop_cycle=monochrome) | |
| 894 | |
| 887 def plotIndicatorMap(indicatorMap, squareSize, masked = True, defaultValue=-1): | 895 def plotIndicatorMap(indicatorMap, squareSize, masked = True, defaultValue=-1): |
| 888 from matplotlib.pyplot import pcolor | 896 from matplotlib.pyplot import pcolor |
| 889 coords = array(indicatorMap.keys()) | 897 coords = array(indicatorMap.keys()) |
| 890 minX = min(coords[:,0]) | 898 minX = min(coords[:,0]) |
| 891 minY = min(coords[:,1]) | 899 minY = min(coords[:,1]) |
