makeplots.md 18.6 KB
 Christian Bierlich committed Dec 20, 2019 1 2 ``````# make-plots `````` Christian Bierlich committed Dec 20, 2019 3 4 5 ``````The plots produced with `rivet-mkhtml` are really rendered with the command `make-plots`, which is called under the hood. The `make-plots` command can also be used to create figures from the simple .dat text format produced by `rivet-cmphistos` directly. The `make-plots` script is quite powerful, and includes several options to modify plotting style, adding curves or fits and more. For use with Rivet, the syntax documented in this document should be provided in the .plot file. Internally, `make-plots` the simple text format and converts them into PostScript or PDF files by creating a LaTeX file and running `latex`, `dvips`, and maybe `ps2pdf`. `````` Christian Bierlich committed Dec 20, 2019 6 7 8 9 10 `````` ## Usage To run `make-plots` call `````` Christian Bierlich committed Dec 20, 2019 11 ````````` `````` Christian Bierlich committed Dec 20, 2019 12 `````` make-plots [options] file.dat [file2.dat ...] `````` Christian Bierlich committed Dec 20, 2019 13 ````````` `````` Christian Bierlich committed Dec 20, 2019 14 15 16 `````` All available options can be listed by running `````` Christian Bierlich committed Dec 20, 2019 17 ````````` `````` Christian Bierlich committed Dec 20, 2019 18 `````` make-plots --help `````` Christian Bierlich committed Dec 20, 2019 19 ````````` `````` Christian Bierlich committed Dec 20, 2019 20 21 22 23 24 25 26 27 `````` ### Configuration files `make-plots` typically takes the plotting instructions and settings from the input ascii files as described in the "Input Format" chapter. It is also possible though to pass a global configuration file to `make-plots` (cf. `--help`) which allows to specify/overwrite settings for certain plots or histograms in a plot on top of what the input files specify. This could be useful if the ascii files are generated automatically (e.g. with `rivet-mkhtml` or `compare-histos`) and you still want to apply custom plotting options. An example for this looks like: `````` Christian Bierlich committed Dec 20, 2019 28 ````````` `````` Christian Bierlich committed Dec 20, 2019 29 30 31 32 33 34 `````` # BEGIN PLOT figures/MC_WJETS/W_mass.dat XMin=60.0 XMax=100.0 LegendXPos=0.65 # END PLOT `````` Christian Bierlich committed Dec 20, 2019 35 `````` .*myLOrun.yoda/D0_2008_S7554427/d01-x01-y01::Scale=1.0 `````` Christian Bierlich committed Dec 20, 2019 36 `````` `````` Christian Bierlich committed Dec 20, 2019 37 ````````` `````` Christian Bierlich committed Dec 20, 2019 38 39 40 41 42 43 44 45 46 47 48 49 50 `````` Here first the options in the `PLOT` section of a specific ascii file are being amended/overwritten. The second part shows how to overwrite the `Scale` property of one specific histogram line using the ID of the histogram. ## Input Format The ascii files which can be read by `make-plots` are divided into sections. There are four types of sections which are called `PLOT`, `HISTOGRAM`, `FUNCTION`, and `SPECIAL`. Every file must contain exactly one `PLOT` section and at least one section of the other three types. There may be multiple `HISTOGRAM`, `FUNCTION`, and `SPECIAL` sections. Empty lines and lines starting with `#` are ignored, except for the section delimiters described below. ### PLOT The `PLOT` section starts with `````` Christian Bierlich committed Dec 20, 2019 51 ````````` `````` Christian Bierlich committed Dec 20, 2019 52 53 `````` # BEGIN PLOT `````` Christian Bierlich committed Dec 20, 2019 54 ````````` `````` Christian Bierlich committed Dec 20, 2019 55 56 57 ``````and ends with `````` Christian Bierlich committed Dec 20, 2019 58 ````````` `````` Christian Bierlich committed Dec 20, 2019 59 60 `````` # END PLOT `````` Christian Bierlich committed Dec 20, 2019 61 ````````` `````` Christian Bierlich committed Dec 20, 2019 62 63 64 65 66 67 `````` Every file must have exactly one `PLOT` section. In this section global parameters are specified, like the axis labels, the plot title, size, … An empty `PLOT` section is perfectly legal, though. In this section the following parameters can be set: #### Titles, Labels `````` Christian Bierlich committed Dec 20, 2019 68 ````````` `````` Christian Bierlich committed Dec 20, 2019 69 70 `````` Title= `````` Christian Bierlich committed Dec 20, 2019 71 ````````` `````` Christian Bierlich committed Dec 20, 2019 72 73 ``````The title of the plot. `````` Christian Bierlich committed Dec 20, 2019 74 ````````` `````` Christian Bierlich committed Dec 20, 2019 75 76 77 78 `````` XLabel=<label> YLabel=<label> ZLabel=<label> `````` Christian Bierlich committed Dec 20, 2019 79 ````````` `````` Christian Bierlich committed Dec 20, 2019 80 81 82 ``````Axis labels for the x-, y-, and z-axis. `````` Christian Bierlich committed Dec 20, 2019 83 ````````` `````` Christian Bierlich committed Dec 20, 2019 84 85 86 87 `````` XLabelSep=<distance> YLabelSep=<distance> ZLabelSep=<distance> `````` Christian Bierlich committed Dec 20, 2019 88 ````````` `````` Christian Bierlich committed Dec 20, 2019 89 90 ``````Distance between the axis label and the plot in units of `\labelsep`. `````` Christian Bierlich committed Dec 20, 2019 91 ````````` `````` Christian Bierlich committed Dec 20, 2019 92 93 94 95 96 97 `````` XMajorTickMarks=<last_digit> YMajorTickMarks=<last_digit> ZMajorTickMarks=<last_digit> XMinorTickMarks=<nticks> YMinorTickMarks=<nticks> ZMinorTickMarks=<nticks> `````` Christian Bierlich committed Dec 20, 2019 98 ````````` `````` Christian Bierlich committed Dec 20, 2019 99 100 101 `````` `make-plots` tries to guess the distance between tickmarks automatically. If you are not satisfied with its result, you can override this by setting `<last_digit>` to 1, 2, 5, or 10, and `<nticks>` to the number of minor ticks you like. _Note_: These options are not available for logarithmic axes. `````` Christian Bierlich committed Dec 20, 2019 102 ````````` `````` Christian Bierlich committed Dec 20, 2019 103 104 105 `````` XTwosidedTicks=<0|1> YTwosidedTicks=<0|1> `````` Christian Bierlich committed Dec 20, 2019 106 ````````` `````` Christian Bierlich committed Dec 20, 2019 107 108 ``````Draw tickmarks also on the upper and/or right side of the plot. `````` Christian Bierlich committed Dec 20, 2019 109 ````````` `````` Christian Bierlich committed Dec 20, 2019 110 111 112 113 `````` XCustomMajorTicks=<list> YCustomMajorTicks=<list> ZCustomMajorTicks=<list> `````` Christian Bierlich committed Dec 20, 2019 114 ````````` `````` Christian Bierlich committed Dec 20, 2019 115 116 117 118 `````` To specify major ticks at arbitrary positions and/or with arbitrary labels. `<list>` is a whitespace-separated list of format `value1 <spaces_or_tabs> label1 <spaces_or_tabs> value2 <spaces_or_tabs> label2 ...`. `````` Christian Bierlich committed Dec 20, 2019 119 ``````[//]: # TODO: allow use of YAML-style list syntax to clarify delimiters? `````` Christian Bierlich committed Dec 20, 2019 120 `````` `````` Christian Bierlich committed Dec 20, 2019 121 ````````` `````` Christian Bierlich committed Dec 20, 2019 122 123 124 `````` XCustomMinorTicks=<list> YCustomMinorTicks=<list> ZCustomMinorTicks=<list> `````` Christian Bierlich committed Dec 20, 2019 125 ````````` `````` Christian Bierlich committed Dec 20, 2019 126 127 ``````To specify minor ticks at arbitrary positions. `<list>` is a tab separated list of format `value1 <tab> value2 <tab> value3 ...`. `````` Christian Bierlich committed Dec 20, 2019 128 ````````` `````` Christian Bierlich committed Dec 20, 2019 129 130 131 `````` PlotXTickLabels=<0|1> RatioPlotTickLabels=<0|1> `````` Christian Bierlich committed Dec 20, 2019 132 ````````` `````` Christian Bierlich committed Dec 20, 2019 133 134 135 136 137 ``````Disable/enable plotting of the tick labels in the plot and ratio plot (useful if multiple plots are to be combined manually later). #### Axes `````` Christian Bierlich committed Dec 20, 2019 138 ````````` `````` Christian Bierlich committed Dec 20, 2019 139 140 141 142 `````` LogX=<0|1> LogY=<0|1> LogZ=<0|1> `````` Christian Bierlich committed Dec 20, 2019 143 ````````` `````` Christian Bierlich committed Dec 20, 2019 144 145 ``````Use a logarithmic x-, y-, or z-axis. Default is linear. `````` Christian Bierlich committed Dec 20, 2019 146 ````````` `````` Christian Bierlich committed Dec 20, 2019 147 148 149 150 151 152 153 154 155 `````` XMin=<value> XMax=<value> YMin=<value> YMax=<value> ZMin=<value> ZMax=<value> FullRange=<0|1> ShowZero=<0|1> `````` Christian Bierlich committed Dec 20, 2019 156 ````````` `````` Christian Bierlich committed Dec 20, 2019 157 158 159 160 ``````Specify the plot range. By default the range is chosen such that all data is visible in linear plots, and the zero is visible. `ShowZero=0` suppresses plotting the zero in linear plots and thus zooms into the actual y-value range of the distribution. In logarithmic plots the automatic choice of `YMin` is limited to be not smaller than 2e-4*`YMax`, but manually you can specify any value. `FullRange=1` also overrides the 2e-4*`YMax` limit and plots the full range in y. #### Normalization, Rebinning `````` Christian Bierlich committed Dec 20, 2019 161 ````````` `````` Christian Bierlich committed Dec 20, 2019 162 163 164 `````` NormalizeToIntegral=<1|0> NormalizeToSum=<1|0> Scale=<factor> `````` Christian Bierlich committed Dec 20, 2019 165 ````````` `````` Christian Bierlich committed Dec 20, 2019 166 167 ``````Normalize all histograms to their integral, to their sum of entries, or scale them by some arbitrary factor. Normalization and scale options in the `PLOT` section override the corresponding option in the `HISTOGRAM` section. The scale factor is applied after normalization. `````` Christian Bierlich committed Dec 20, 2019 168 ````````` `````` Christian Bierlich committed Dec 20, 2019 169 `````` Rebin=<nbins> `````` Christian Bierlich committed Dec 20, 2019 170 ````````` `````` Christian Bierlich committed Dec 20, 2019 171 172 173 174 ``````Rebin all histograms in this plot. Syntax and functionality is the same as for the Rebin option in the `HISTOGRAM` section. #### Sizes and Margins `````` Christian Bierlich committed Dec 20, 2019 175 176 177 ````````` PlotSize=<xsize,ysize> ``` `````` Christian Bierlich committed Dec 20, 2019 178 179 ``````Size in x and y direction of the plot. This can be specified in any unit LaTeX understands. `````` Christian Bierlich committed Dec 20, 2019 180 ````````` `````` Christian Bierlich committed Dec 20, 2019 181 182 183 184 `````` LeftMargin=<size> RightMargin=<size> TopMargin=<size> BottomMargin=<size> `````` Christian Bierlich committed Dec 20, 2019 185 ````````` `````` Christian Bierlich committed Dec 20, 2019 186 187 188 `````` Distance between the plot and the paper edge. `````` Christian Bierlich committed Dec 20, 2019 189 ````````` `````` Christian Bierlich committed Dec 20, 2019 190 `````` FrameColor=<color> `````` Christian Bierlich committed Dec 20, 2019 191 ````````` `````` Christian Bierlich committed Dec 20, 2019 192 193 194 195 ``````Background color for the margin around the plot. #### Legends `````` Christian Bierlich committed Dec 20, 2019 196 ````````` `````` Christian Bierlich committed Dec 20, 2019 197 `````` Legend=<0|1> `````` Christian Bierlich committed Dec 20, 2019 198 ````````` `````` Christian Bierlich committed Dec 20, 2019 199 200 ``````Display a legend in the plot. `````` Christian Bierlich committed Dec 20, 2019 201 ````````` `````` Christian Bierlich committed Dec 20, 2019 202 `````` CustomLegend=<text> `````` Christian Bierlich committed Dec 20, 2019 203 ````````` `````` Christian Bierlich committed Dec 20, 2019 204 205 206 `````` Custom text that is added to the legend. `````` Christian Bierlich committed Dec 20, 2019 207 ````````` `````` Christian Bierlich committed Dec 20, 2019 208 209 `````` LegendXPos=<pos> LegendYPos=<pos> `````` Christian Bierlich committed Dec 20, 2019 210 ````````` `````` Christian Bierlich committed Dec 20, 2019 211 212 ``````Position of the legend within the plot. Anchor point is the top left corner of the legend, so units typically range between 0.0 and 1.0. `````` Christian Bierlich committed Dec 20, 2019 213 ````````` `````` Christian Bierlich committed Dec 20, 2019 214 `````` LegendAlign=<align> `````` Christian Bierlich committed Dec 20, 2019 215 ````````` `````` Christian Bierlich committed Dec 20, 2019 216 217 ``````Horizontal alignment of the legend: `LegendAlign=l` is the default and will create a left-aligned legend, while `LegendAlign=r` is right-aligned with the keys on the right hand side. `````` Christian Bierlich committed Dec 20, 2019 218 ````````` `````` Christian Bierlich committed Dec 20, 2019 219 `````` LegendOnly=<list> `````` Christian Bierlich committed Dec 20, 2019 220 ````````` `````` Christian Bierlich committed Dec 20, 2019 221 222 223 224 225 ``````Whitespace separated list of IDs. These can be histograms or functions. The legend is only shown for the listed objects. Without this option, all plotted objects which have a title enter the legend. The legend titles are plotted in the given order, so there are cases in which it makes sense to use `LegendOnly` together with all histogram IDs. It is also possible to specify the legend order on an entry-by-entry basis using the `LegendOrder=<int>` setting for each histogram or function. #### Plotting Options `````` Christian Bierlich committed Dec 20, 2019 226 ````````` `````` Christian Bierlich committed Dec 20, 2019 227 `````` DrawOnly=<list> `````` Christian Bierlich committed Dec 20, 2019 228 ````````` `````` Christian Bierlich committed Dec 20, 2019 229 230 231 `````` Whitespace separated list of histogram IDs. Only the histograms in this list are plotted, even if there are more histograms defined in the file. The histograms are plotted in the given order, so there are cases in which it makes sense to use `DrawOnly` together with all histogram IDs. This is especially useful for the `Stack` option. It is also possible to specify the plotting order on a histogram-by-histogram basis using the `PlotOrder=<int>` setting for each histogram. `````` Christian Bierlich committed Dec 20, 2019 232 ````````` `````` Christian Bierlich committed Dec 20, 2019 233 `````` Stack=<list> `````` Christian Bierlich committed Dec 20, 2019 234 ````````` `````` Christian Bierlich committed Dec 20, 2019 235 236 ``````Whitespace separated list of histogram IDs. The histograms will be added on top of each other. This is useful for example to compare data with background if the background has contributions from several histograms. `````` Christian Bierlich committed Dec 20, 2019 237 ````````` `````` Christian Bierlich committed Dec 20, 2019 238 239 `````` DrawSpecialFirst=<0|1> DrawFunctionFirst=<0|1> `````` Christian Bierlich committed Dec 20, 2019 240 ````````` `````` Christian Bierlich committed Dec 20, 2019 241 242 ``````By default the `SPECIAL` and `FUNCTION` sections are plotted after the histograms. With these options you can override that behaviour. `````` Christian Bierlich committed Dec 20, 2019 243 ````````` `````` Christian Bierlich committed Dec 20, 2019 244 `````` ConnectGaps=<0|1> `````` Christian Bierlich committed Dec 20, 2019 245 ````````` `````` Christian Bierlich committed Dec 20, 2019 246 247 248 249 250 251 252 ``````If error bars are disabled and you want to bridge gaps in a histogram, you can set this parameter. By default it is off. Setting it in the `PLOT` section affects all histograms, but you can also set it in the `HISTOGRAM` section for individual histograms. The local setting overrides the global setting. #### Comparison Plots With the `````` Christian Bierlich committed Dec 20, 2019 253 ````````` `````` Christian Bierlich committed Dec 20, 2019 254 255 `````` RatioPlot=1 RatioPlotReference=<histogram_ID> `````` Christian Bierlich committed Dec 20, 2019 256 ````````` `````` Christian Bierlich committed Dec 20, 2019 257 ``````options you can create ratio plots for two or more histograms. Note that you must specify your reference data ID. This option is used by the `compare-histos` script. `````` Christian Bierlich committed Dec 20, 2019 258 `````` `````` Christian Bierlich committed Dec 20, 2019 259 ````````` `````` Christian Bierlich committed Dec 20, 2019 260 `````` RatioPlotMode=<default|deviation|datamc> `````` Christian Bierlich committed Dec 20, 2019 261 ````````` `````` Christian Bierlich committed Dec 20, 2019 262 263 264 265 266 `````` By default, the ratio plot displays MC/Data. You can switch to (MC-data)/uncertainty (`deviation`) or Data/MC (`datamc`) with this option. In ratio plots the following additional options are available and work in a similar way as their regular counterparts: `````` Christian Bierlich committed Dec 20, 2019 267 ````````` `````` Christian Bierlich committed Dec 20, 2019 268 269 270 271 272 `````` RatioPlotYLabel=<label> RatioPlotYMin=<value> RatioPlotYMax=<value> RatioPlotYSize=<size> RatioPlotErrorBandColor=<color> `````` Christian Bierlich committed Dec 20, 2019 273 ````````` `````` Christian Bierlich committed Dec 20, 2019 274 275 276 `````` By default, the reference data is plotted using a yellow error band around the central value of the ratio plot. If you would rather have it plotted in the same style as in the main plot (e.g. with black errorbars), you can specify: `````` Christian Bierlich committed Dec 20, 2019 277 ````````` `````` Christian Bierlich committed Dec 20, 2019 278 `````` RatioPlotSameStyle=1 `````` Christian Bierlich committed Dec 20, 2019 279 ````````` `````` Christian Bierlich committed Dec 20, 2019 280 281 282 `````` If you only want the ratio plot without showing the actual data distribution, you can switch off the main plot. This option implies `RatioPlot=1`: `````` Christian Bierlich committed Dec 20, 2019 283 ````````` `````` Christian Bierlich committed Dec 20, 2019 284 `````` MainPlot=0 `````` Christian Bierlich committed Dec 20, 2019 285 ````````` `````` Christian Bierlich committed Dec 20, 2019 286 287 288 289 290 291 292 `````` #### Goodness of Fit `make-plots` can calculate the goodness of fit between histograms and display the result in the legend. It is also possible to change the color of the margin around the plot depending on the GoF. This is useful to provide a quick overview when looking at many plots. `````` Christian Bierlich committed Dec 20, 2019 293 ````````` `````` Christian Bierlich committed Dec 20, 2019 294 `````` GofType=chi2 `````` Christian Bierlich committed Dec 20, 2019 295 ````````` `````` Christian Bierlich committed Dec 20, 2019 296 297 298 299 `````` The type of GoF. The default is `chi2` and currently that’s the only option. `````` Christian Bierlich committed Dec 20, 2019 300 ````````` `````` Christian Bierlich committed Dec 20, 2019 301 `````` GofReference=<histogram_ID> `````` Christian Bierlich committed Dec 20, 2019 302 ````````` `````` Christian Bierlich committed Dec 20, 2019 303 304 305 306 307 308 `````` specifies the reference histogram to be used for the GoF calculation. If this option is omitted, the fallback is `RatioPlotReference`. The GoF calculation is activated by two options: `````` Christian Bierlich committed Dec 20, 2019 309 ````````` `````` Christian Bierlich committed Dec 20, 2019 310 311 `````` GofLegend=<0|1> GofFrame=<histogram_ID> `````` Christian Bierlich committed Dec 20, 2019 312 ````````` `````` Christian Bierlich committed Dec 20, 2019 313 314 315 `````` `GofLegend` calculates the GoF for all histograms and displays the results in the legend. With `GofFrame` you can specify a single histogram for which the GoF result will be shown in the legend and used to assign a color to the plot margins. Note that `FrameColor` overrides the color choice for the margin. You can use `````` Christian Bierlich committed Dec 20, 2019 316 ````````` `````` Christian Bierlich committed Dec 20, 2019 317 318 `````` GofFrameColor=<colorthresholds> `````` Christian Bierlich committed Dec 20, 2019 319 ````````` `````` Christian Bierlich committed Dec 20, 2019 320 321 322 323 324 325 326 `````` to specify the thresholds for the frame color. This option takes a list of `<threshold>:<color>` pairs, separated by whitespace. The default is `GofFrameColor=0:green 3:yellow 6:red!70`. Again, if you use `FrameColor`, this option is disabled. #### Color Palettes for 2-dim Plots With the option `ColorSeries` you can define a custom color palette for 2-dimensional plots. The syntax is the same as for the `\definecolorseries` command in the `xcolor` LaTeX package after the color series name, i.e. `{core-model}{method}[begin-model]{begin-spec}[end-model]{end-spec}`. For more information you can consult the [xcolor documentation](http://www.ctan.org/tex-archive/macros/latex/contrib/xcolor/xcolor.pdf). Here is an example: `````` Christian Bierlich committed Dec 20, 2019 327 ````````` `````` Christian Bierlich committed Dec 20, 2019 328 `````` ColorSeries={rgb}{last}[rgb]{1,0.97,0.94}[rgb]{0.6,0.0,0.05} `````` Christian Bierlich committed Dec 20, 2019 329 ````````` `````` Christian Bierlich committed Dec 20, 2019 330 331 332 333 ``````### HISTOGRAM The `HISTOGRAM` section starts with `````` Christian Bierlich committed Dec 20, 2019 334 ````````` `````` Christian Bierlich committed Dec 20, 2019 335 `````` # BEGIN HISTOGRAM <ID> `````` Christian Bierlich committed Dec 20, 2019 336 ````````` `````` Christian Bierlich committed Dec 20, 2019 337 338 339 `````` and ends with `````` Christian Bierlich committed Dec 20, 2019 340 ````````` `````` Christian Bierlich committed Dec 20, 2019 341 `````` # END HISTOGRAM `````` Christian Bierlich committed Dec 20, 2019 342 ````````` `````` Christian Bierlich committed Dec 20, 2019 343 344 345 346 347 348 349 `````` There can be more than one `HISTOGRAM` section in a file. Histograms are identified by `<ID>` which can be any string _not_ containing whitespace. #### Data Format Lines starting with a number (positive or negative) are interpreted as data. Each line specifies one bin. The fields in each line must be separated by tabs, not spaces (this needs to be fixes some day). For 1-dimensional histograms the format can be `````` Christian Bierlich committed Dec 20, 2019 350 ````````` `````` Christian Bierlich committed Dec 20, 2019 351 352 `````` <lowerbinedge> <upperbinedge> <value> <error> <lowerbinedge> <upperbinedge> <value> <minuserror> <pluserror> `````` Christian Bierlich committed Dec 20, 2019 353 ````````` `````` Christian Bierlich committed Dec 20, 2019 354 355 356 `````` 2-dimensional histograms are supported, too. They are plotted as colormap (errors are ignored) and specified as `````` Christian Bierlich committed Dec 20, 2019 357 ````````` `````` Christian Bierlich committed Dec 20, 2019 358 `````` <lowerxbinedge> <upperxbinedge> <lowerybinedge> <upperybinedge> <value> <error> `````` Christian Bierlich committed Dec 20, 2019 359 ````````` `````` Christian Bierlich committed Dec 20, 2019 360 361 362 `````` #### Titles `````` Christian Bierlich committed Dec 20, 2019 363 ````````` `````` Christian Bierlich committed Dec 20, 2019 364 `````` Title=<title> `````` Christian Bierlich committed Dec 20, 2019 365 ````````` `````` Christian Bierlich committed Dec 20, 2019 366 367 368 369 370 `````` Title of the histogram. This is used for the legend. #### Linestyles `````` Christian Bierlich committed Dec 20, 2019 371 ````````` `````` Christian Bierlich committed Dec 20, 2019 372 `````` LineStyle=<style> `````` Christian Bierlich committed Dec 20, 2019 373 ````````` `````` Christian Bierlich committed Dec 20, 2019 374 375 376 `````` Any linestyle that is understood by the LaTeX pstricks package, e.g. `solid`, `dotted`, `dashed`, `none`, as well as a special `dashdotted` (or `dotdashed`) linestyle which does what you might expect. `````` Christian Bierlich committed Dec 20, 2019 377 ````````` `````` Christian Bierlich committed Dec 20, 2019 378 `````` LineColor=<color> `````` Christian Bierlich committed Dec 20, 2019 379 ````````` `````` Christian Bierlich committed Dec 20, 2019 380 381 ``````Color of the line. Default is black, but any color that pstricks understands can be used, including constructions like `red!70!blue!20` (for mixing colors), `{[rgb]{0.8,0,0.7}}` (for RGB-colors), `{[wave]{580}}` (for wavelengths in nm), `LineColor={[cmyk]{1,1,0,0}}` for CMYK-colors, or `[hsb]{0.5,1,1}` for HSB-colors. `````` Christian Bierlich committed Dec 20, 2019 382 ````````` `````` Christian Bierlich committed Dec 20, 2019 383 `````` LineOpacity=<opacity> `````` Christian Bierlich committed Dec 20, 2019 384 ````````` `````` Christian Bierlich committed Dec 20, 2019 385 386 387 `````` Set the opacity of the line. Default is 1.0\. This might not work for ps output. `````` Christian Bierlich committed Dec 20, 2019 388 ````````` `````` Christian Bierlich committed Dec 20, 2019 389 `````` LineWidth=<width> `````` Christian Bierlich committed Dec 20, 2019 390 ````````` `````` Christian Bierlich committed Dec 20, 2019 391 392 393 `````` Width of the line. `````` Christian Bierlich committed Dec 20, 2019 394 ````````` `````` Christian Bierlich committed Dec 20, 2019 395 `````` LineDash=<dashstyle> `````` Christian Bierlich committed Dec 20, 2019 396 ````````` `````` Christian Bierlich committed Dec 20, 2019 397 398 399 `````` If `LineStyle` is set to `dashed`, you can specify the dash style with this option. Anything that is understood by pstrick’s `dash=...` option is valid. An example for a dash-dotted line is `LineDash=3pt 3pt .8pt 3pt`. You can use `LineStyle=dashdotted` or `LineStyle=dotdashed` as an abbreviation for `LineStyle=dashed` with `LineDash=3pt 3pt .8pt 3pt`. `````` Christian Bierlich committed Dec 20, 2019 400 ````````` `````` Christian Bierlich committed Dec 20, 2019 401 `````` ConnectBins=<0|1> `````` Christian Bierlich committed Dec 20, 2019 402 ````````` `````` Christian Bierlich committed Dec 20, 2019 403 404 405 `````` Choose whether to connect adjacent bins' horizontal lines together by a vertical line on the bin edge. This is enabled by default, but you may wish to disable it when plotting reference data with error bars and point markers. `````` Christian Bierlich committed Dec 20, 2019 406 ````````` `````` Christian Bierlich committed Dec 20, 2019 407 `````` ConnectGaps=<0|1> `````` Christian Bierlich committed Dec 20, 2019 408 ````````` `````` Christian Bierlich committed Dec 20, 2019 409 410 411 `````` If ConnectBins is enabled and you want to bridge gaps in a histogram, you can set this parameter. By default it is off. Setting it in the `PLOT` section affects all histograms, but you can also set it in the `HISTOGRAM` section for individual histograms. The local setting overrides the global setting. `````` Christian Bierlich committed Dec 20, 2019 412 ````````` `````` Christian Bierlich committed Dec 20, 2019 413 `````` SmoothLine=<0|1> `````` Christian Bierlich committed Dec 20, 2019 414 ````````` `````` Christian Bierlich committed Dec 20, 2019 415 416 417 418 419 `````` Draw a smooth curve rather than a histogram #### Fillstyles `````` Christian Bierlich committed Dec 20, 2019 420 ````````` `````` Christian Bierlich committed Dec 20, 2019 421 422 `````` FillStyle=<style> FillColor=<color> `````` Christian Bierlich committed Dec 20, 2019 423 ````````` `````` Christian Bierlich committed Dec 20, 2019 424 425 426 `````` To fill the area below a histogram, set `FillStyle` and `FillColor` to something pstricks understands. Examples for the style are `solid` or `vlines`. See `LineColor` for examples of color definitions. `````` Christian Bierlich committed Dec 20, 2019 427 ````````` `````` Christian Bierlich committed Dec 20, 2019 428 `````` FillOpacity=<opacity> `````` Christian Bierlich committed Dec 20, 2019 429 ````````` `````` Christian Bierlich committed Dec 20, 2019 430 431 432 `````` Set the opacity of the solid fillcolor. Default is 1.0\. This might not work for ps output. `````` Christian Bierlich committed Dec 20, 2019 433 ````````` `````` Christian Bierlich committed Dec 20, 2019 434 `````` HatchColor=<color> `````` Christian Bierlich committed Dec 20, 2019 435 ````````` `````` Christian Bierlich committed Dec 20, 2019 436 437 438 439 440 `````` The color of a hatch pattern used for filling the area below a histogram. This is used for example when you use `vlines` as style. #### Data Points `````` Christian Bierlich committed Dec 20, 2019 441 ````````` `````` Christian Bierlich committed Dec 20, 2019 442 `````` ErrorBars=<0|1> `````` Christian Bierlich committed Dec 20, 2019 443 ````````` `````` Christian Bierlich committed Dec 20, 2019 444 445 446 `````` Turn on error bars. `````` Christian Bierlich committed Dec 20, 2019 447 ````````` `````` Christian Bierlich committed Dec 20, 2019 448 449 `````` ErrorBands=<0|1> ErrorBandColor=<color> `````` Christian Bierlich committed Dec 20, 2019 450 ````````` `````` Christian Bierlich committed Dec 20, 2019 451 452 ``````Turn on error bands and set their color (see `LineColor` for a description of color definitions). `````` Christian Bierlich committed Dec 20, 2019 453 ````````` `````` Christian Bierlich committed Dec 20, 2019 454 `````` ErrorBandOpacity=<opacity> `````` Christian Bierlich committed Dec 20, 2019 455 ````````` `````` Christian Bierlich committed Dec 20, 2019 456 457 458 `````` Set the opacity of the error band. Default is 1.0\. This might not work for ps output. `````` Christian Bierlich committed Dec 20, 2019 459 ````````` `````` Christian Bierlich committed Dec 20, 2019 460 `````` PolyMarker=<dotstyle> `````` Christian Bierlich committed Dec 20, 2019 461 ````````` `````` Christian Bierlich committed Dec 20, 2019 462 463 464 `````` The marker style of the points. Any dot style which is understood by pstricks is valid, e.g. `*`, `o`, `triangle`, `diamond`, … `````` Christian Bierlich committed Dec 20, 2019 465 ````````` `````` Christian Bierlich committed Dec 20, 2019 466 467 `````` DotSize=<size> DotScale=<factor> `````` Christian Bierlich committed Dec 20, 2019 468 ````````` `````` Christian Bierlich committed Dec 20, 2019 469 470 471 472 473 `````` The size of the markers. With `DotSize` you can specify the absolute size, e.g. in units of `pt`, while `DotScale` is a relative measure with respect to the default size. #### Normalization, Rebinning `````` Christian Bierlich committed Dec 20, 2019 474 ````````` `````` Christian Bierlich committed Dec 20, 2019 475 476 477 `````` NormalizeToIntegral=<1|0> NormalizeToSum=<1|0> Scale=<factor> `````` Christian Bierlich committed Dec 20, 2019 478 ````````` `````` Christian Bierlich committed Dec 20, 2019 479 480 481 `````` Normalize the histogram to the integral, to the sum of entries, or scale it by some arbitrary factor. If normalization and a scale factor are given, the scale factor is applied after normalization. This is useful for stacking histograms when the ratios are known. `````` Christian Bierlich committed Dec 20, 2019 482 ````````` `````` Christian Bierlich committed Dec 20, 2019 483 484 `````` Rebin=<nbins> ErrorType=<stat|env> `````` Christian Bierlich committed Dec 20, 2019 485 ````````` `````` Christian Bierlich committed Dec 20, 2019 486 `````` `````` Frank Siegert committed Feb 10, 2020 487 ``````Rebin the histogram. Starting with the lowest bin `<nbins>` bins are combined into a new bin. If the number of bins in the histogram is not a multiple of `<nbins>`, the remaining bins at the upper histogram end are silently ignored (i.e. if the original histogram has 10 bins and `<nbins>` is 3, the plotted histogram shows three bins combining the bins 1—9 of the original histogram). The treatment of the errors is determined by the given ErrorType: `stat` (default) assumes the errors are of statistical nature and combines them in quadrature sum, while `env` allows to treat errors as envelope of various uncertainty runs which are combined linearly. `````` Christian Bierlich committed Dec 20, 2019 488 489 490 491 492 `````` ### FUNCTION `make-plots` can draw arbitrary functions. These functions are defined as python code sniplets which are evaluated by `make-plots`. The code sniplet must come after all other options in a `FUNCTION` section and are preceded by `Code=` on a single line. An example `FUNCTION` section might look like this: `````` Christian Bierlich committed Dec 20, 2019 493 ````````` `````` Christian Bierlich committed Dec 20, 2019 494 495 496 497 498 499 500 501 502 503 504 505 506 `````` # BEGIN FUNCTION f_cc LineColor=red Code= p0=16.4 p1=1.25 p2=0.9832 from scipy.special import erf x-=0.5 if x<=0: return 0 else: return .5*p2*(1.+erf( (x-p0)/sqrt(x*p1) )) # END FUNCTION `````` Christian Bierlich committed Dec 20, 2019 507 ````````` `````` Christian Bierlich committed Dec 20, 2019 508 509 510 511 512 `````` #### Common Options with HISTOGRAM The following options have the same meaning as in the `HISTOGRAM` section: `````` Christian Bierlich committed Dec 20, 2019 513 ````````` `````` Christian Bierlich committed Dec 20, 2019 514 515 516 517 518 519 520 521 `````` Title=<title> LineStyle=<style> LineColor=<color> LineWidth=<width> LineDash=<dashstyle> FillStyle=<style> FillColor=<color> HatchColor=<color> `````` Christian Bierlich committed Dec 20, 2019 522 ````````` `````` Christian Bierlich committed Dec 20, 2019 523 524 525 526 527 `````` #### Function Range You can limit the plot range of functions by specifying `````` Christian Bierlich committed Dec 20, 2019 528 ````````` `````` Christian Bierlich committed Dec 20, 2019 529 530 `````` XMin=<value> XMax=<value> `````` Christian Bierlich committed Dec 20, 2019 531 ````````` `````` Christian Bierlich committed Dec 20, 2019 532 533 534 535 536 `````` ### SPECIAL The `SPECIAL` sections are used to include any custom pstricks code. This is useful for drawing arrows and lines, put text at any position into the plot, etc. The default coordinate system is defined to be `(0,0)` at the lower left and `(1,1)` at the upper right corner of the plot. By putting the `\physicscoor` command in front of a coordinate pair, these coordinates are interpreted not in the pstricks coordinate system, but in the physics coordinate system of the plot, which is useful e.g. for marking cut values in a plot. Similar `\physicsxcoor` and `\physicsycoor` commands exist which will only treat the x or y coordinate respectively as being in physics units. `````` Christian Bierlich committed Dec 20, 2019 537 ``````*Hint:* If you want to clip your `SPECIAL` code to the plot area, you can use `````` Christian Bierlich committed Dec 20, 2019 538 `````` `````` Christian Bierlich committed Dec 20, 2019 539 ````````` `````` Christian Bierlich committed Dec 20, 2019 540 541 542 `````` \psclip{\psframe[linewidth=0, linestyle=none](0,0)(1,1)} ... \endpsclip `````` Christian Bierlich committed Dec 20, 2019 543 ````````` `````` Christian Bierlich committed Dec 20, 2019 544 545 546 `````` An example of a `SPECIAL` section might look like this: `````` Christian Bierlich committed Dec 20, 2019 547 ````````` `````` Christian Bierlich committed Dec 20, 2019 548 549 550 551 552 553 554 555 `````` # BEGIN SPECIAL \psclip{\psframe[linewidth=0, linestyle=none](0,0)(1,1)} \psline[linewidth=1.2pt,linecolor=red]{<-}\physicscoor(2.83,2)\physicscoor(2.83,18) \uput{4pt}[180]{0}\physicscoor(2.83,12){observed} \psline[linewidth=0.8pt,linecolor=red,linestyle=dashed]\physicscoor( 3.17,0)\physicscoor( 3.17,28.14) \psline[linewidth=0.8pt,linecolor=red,linestyle=dashed]\physicscoor(-3.59,0)\physicscoor(-3.59,28.14) \endpsclip # END SPECIAL `````` Christian Bierlich committed Dec 20, 2019 556 ```````