Commit 8bf27013 authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Use different markers in multi plots.

parent 2d1aea30
......@@ -144,10 +144,15 @@ colors = DotDict(
blue_signal_trans=(67, 118, 201, 0.5),
),
)
# color sequence for plots with multiple elements
color_sequence = ["blue", "red", "green", "grey", "pink", "cyan", "orange", "light_green", "yellow"]
# add black a few times, needs to be updated in case we need more than 9 colors
color_sequence += 10 * ["black"]
# marker sequence for plots with multiple elements
marker_sequence = [21, 22, 23, 24, 25, 26, 32, 27, 33, 28, 34, 29, 30]
marker_sequence += 10 * [20]
# cumulative, inverse chi2 values in a mapping "n_dof -> n_sigma -> level"
# for the geometrical determination of errors of nll curves
# (computed with "sp.stats.chi2.ppf(g, n_dof)" with g being the gaussian intervals)
......
......@@ -11,7 +11,9 @@ import scipy.interpolate
import scipy.optimize
from scinum import Number
from dhi.config import poi_data, br_hh_names, campaign_labels, chi2_levels, colors, color_sequence
from dhi.config import (
poi_data, br_hh_names, campaign_labels, chi2_levels, colors, color_sequence, marker_sequence,
)
from dhi.util import import_ROOT, to_root_latex, create_tgraph, DotDict, minimize_1d
from dhi.plots.util import (
use_style, draw_model_parameters, fill_hist_from_points, create_random_name, get_contours,
......@@ -299,7 +301,7 @@ def plot_likelihood_scans_1d(
legend_entries.append((line_thy, "Theory prediction", "L"))
# perform scans and draw nll curves
for d, col in zip(data, color_sequence[:len(data)]):
for d, col, ms in zip(data, color_sequence[:len(data)], marker_sequence[:len(data)]):
# evaluate the scan, run interpolation and error estimation
scan = evaluate_likelihood_scan_1d(d["values"][poi], d["values"]["dnll2"],
poi_min=d["poi_min"])
......@@ -307,7 +309,7 @@ def plot_likelihood_scans_1d(
# draw the curve
g_nll = create_tgraph(len(d["values"][poi]), d["values"][poi],
d["values"]["dnll2"])
r.setup_graph(g_nll, props={"LineWidth": 2, "MarkerStyle": 20, "MarkerSize": 0.75},
r.setup_graph(g_nll, props={"LineWidth": 2, "MarkerStyle": ms, "MarkerSize": 1.2},
color=colors[col])
draw_objs.append((g_nll, "SAME,CP"))
legend_entries.append((g_nll, to_root_latex(br_hh_names.get(d["name"], d["name"])), "LP"))
......
......@@ -8,7 +8,9 @@ import math
import numpy as np
from dhi.config import poi_data, campaign_labels, colors, color_sequence, br_hh_names
from dhi.config import (
poi_data, br_hh_names, campaign_labels, colors, color_sequence, marker_sequence,
)
from dhi.util import import_ROOT, to_root_latex, create_tgraph, try_int
from dhi.plots.util import (
use_style, draw_model_parameters, create_hh_process_label, determine_limit_digits,
......@@ -308,10 +310,11 @@ def plot_limit_scans(
draw_objs.append((h_dummy, "HIST"))
# central values
for i, (ev, col) in enumerate(zip(expected_values[::-1], color_sequence[:n_graphs][::-1])):
for i, (ev, col, ms) in enumerate(zip(expected_values[::-1], color_sequence[:n_graphs][::-1],
marker_sequence[:n_graphs][::-1])):
mask = ~np.isnan(ev["limit"])
g_exp = create_tgraph(mask.sum(), scan_values[mask], ev["limit"][mask])
r.setup_graph(g_exp, props={"LineWidth": 2, "MarkerStyle": 20, "MarkerSize": 0.7},
r.setup_graph(g_exp, props={"LineWidth": 2, "MarkerStyle": ms, "MarkerSize": 1.2},
color=colors[col])
draw_objs.append((g_exp, "SAME,PL"))
name = names[n_graphs - i - 1]
......
......@@ -8,8 +8,10 @@ import math
import numpy as np
from dhi.config import poi_data, br_hh_names, campaign_labels, colors, color_sequence
from dhi.util import import_ROOT, to_root_latex, create_tgraph, try_int
from dhi.config import (
poi_data, br_hh_names, campaign_labels, colors, color_sequence, marker_sequence,
)
from dhi.util import import_ROOT, to_root_latex, create_tgraph
from dhi.plots.util import use_style, draw_model_parameters
......@@ -233,10 +235,11 @@ def plot_significance_scans(
draw_objs.append((h_dummy, "HIST"))
# expected values
for i, (ev, col) in enumerate(zip(expected_values[::-1], color_sequence[:n_graphs][::-1])):
for i, (ev, col, ms) in enumerate(zip(expected_values[::-1], color_sequence[:n_graphs][::-1],
marker_sequence[:n_graphs][::-1])):
g_exp = create_tgraph(n_points, scan_values, ev["significance"])
r.setup_graph(g_exp, props={"LineWidth": 2, "LineStyle": 1, "MarkerStyle": 20,
"MarkerSize": 0.7}, color=colors[col])
r.setup_graph(g_exp, props={"LineWidth": 2, "LineStyle": 1, "MarkerStyle": ms,
"MarkerSize": 1.2}, color=colors[col])
draw_objs.append((g_exp, "SAME,PL"))
name = names[n_graphs - i - 1]
legend_entries.append((g_exp, to_root_latex(br_hh_names.get(name, name)), "PL"))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment