[Rivet-svn] r4189 - trunk/bin

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Mar 5 17:44:22 GMT 2013


Author: hoeth
Date: Tue Mar  5 17:44:21 2013
New Revision: 4189

Log:
enable more plotting options in rivet-cmphistos

Modified:
   trunk/bin/rivet-cmphistos

Modified: trunk/bin/rivet-cmphistos
==============================================================================
--- trunk/bin/rivet-cmphistos	Tue Mar  5 17:31:45 2013	(r4188)
+++ trunk/bin/rivet-cmphistos	Tue Mar  5 17:44:21 2013	(r4189)
@@ -60,8 +60,8 @@
     stygroup.add_option("--no-plottitle", action="store_true", dest="NOPLOTTITLE",
                         default=False, help="don't show the plot title on the plot "
                         "(useful when the plot description should only be given in a caption)")
-#    stygroup.add_option("--style", dest="STYLE", default="default",
-#                        help="change plotting style: default|bw|talk")
+    stygroup.add_option("--style", dest="STYLE", default="default",
+                        help="change plotting style: default|bw|talk")
     stygroup.add_option("-c", "--config", dest="CONFIGFILES", action="append", default=["~/.make-plots"],
                         help="additional plot config file(s). Settings will be included in the output configuration.")
     parser.add_option_group(stygroup)
@@ -182,23 +182,28 @@
 def setStyle(ao, style):
     ## Set default plot styles (color and line width)
     # colors borrowed from Google Ngrams
-    LINECOLORS = ['ee3311',    # red (Google uses 'dc3912')
-                  '3366cc',    # blue
-                  '109618',    # green
-                  'ff9900',    # orange
-                  '990099',    # lila
-                 ]
+    LINECOLORS = ['{[HTML]{ee3311}}',  # red (Google uses 'dc3912')
+                  '{[HTML]{3366cc}}',  # blue
+                  '{[HTML]{109618}}',  # green
+                  '{[HTML]{ff9900}}',  # orange
+                  '{[HTML]{990099}}']  # lila
     LINESTYLES = ['solid',
                   'dashed',
                   'dashdotted',
-                  'dotted',
-                 ]
+                  'dotted']
+
+    if opts.STYLE == 'talk':
+        ao.setAnnotation('LineWidth', '1pt')
+    if opts.STYLE == 'bw':
+        LINECOLORS = ['black!90',
+                      'black!50',
+                      'black!30']
 
     c = style%len(LINECOLORS)
     s = style/len(LINECOLORS)
 
     ao.setAnnotation('LineStyle', '%s' %LINESTYLES[s])
-    ao.setAnnotation('LineColor', '{[HTML]{%s}}' %LINECOLORS[c])
+    ao.setAnnotation('LineColor', '%s' %LINECOLORS[c])
 
 
 def setOptions(ao, options):
@@ -297,6 +302,10 @@
         if opts.NOPLOTTITLE:
             plot['Title'] = ''
 
+        if opts.STYLE == 'talk':
+            plot['PlotSize'] = '8,6'
+        if opts.STYLE == 'bw':
+            plot['RatioPlotErrorBandColor'] = 'black!10'
 
         ## DrawOnly is needed to keep the order in the Legend equal to the
         ## order of the files on the command line


More information about the Rivet-svn mailing list