|
2 | 2 | Plots of relations between data PDFs and fits. |
3 | 3 | """ |
4 | 4 |
|
5 | | -from __future__ import generator_stop |
6 | | - |
7 | 5 | from collections import defaultdict |
8 | 6 | from collections.abc import Sequence |
9 | 7 | import itertools |
|
28 | 26 | from validphys.coredata import KIN_NAMES |
29 | 27 | from validphys.plotoptions.core import get_info, kitable, transform_result |
30 | 28 | from validphys.results import chi2_stat_labels, chi2_stats |
31 | | -from validphys.sumrules import POL_LIMS, partial_polarized_sum_rules |
| 29 | +from validphys.sumrules import POL_LIMS |
32 | 30 | from validphys.utils import sane_groupby_iter, scale_from_grid, split_ranges |
33 | 31 |
|
34 | 32 | log = logging.getLogger(__name__) |
@@ -301,9 +299,7 @@ def _plot_fancy_impl( |
301 | 299 | min_vals = [] |
302 | 300 | max_vals = [] |
303 | 301 | fig, ax = plotutils.subplots() |
304 | | - ax.set_title( |
305 | | - "{} {}".format(info.dataset_label, info.group_label(samefig_vals, info.figure_by)) |
306 | | - ) |
| 302 | + ax.set_title(f"{info.dataset_label} {info.group_label(samefig_vals, info.figure_by)}") |
307 | 303 |
|
308 | 304 | lineby = sane_groupby_iter(fig_data, info.line_by) |
309 | 305 |
|
@@ -1494,7 +1490,7 @@ def next_options(): |
1494 | 1490 | # if group is None then make sure that shows on legend. |
1495 | 1491 | key = str(group) |
1496 | 1492 | elif marker_by == "kinematics": |
1497 | | - key = None |
| 1493 | + key = None |
1498 | 1494 | else: |
1499 | 1495 | raise ValueError('Unknown marker_by value') |
1500 | 1496 |
|
@@ -1526,8 +1522,10 @@ def next_options(): |
1526 | 1522 | # This is to get the label key |
1527 | 1523 | coords = [], [] |
1528 | 1524 | if marker_by == "kinematics": |
1529 | | - ht_magnitude = np.concatenate( cvdict[key]) / (coords[1] * (1 - coords[0]) ) |
1530 | | - out = ax.scatter(*coords, marker='.', c=ht_magnitude, cmap="viridis", norm=mcolors.LogNorm()) |
| 1525 | + ht_magnitude = np.concatenate(cvdict[key]) / (coords[1] * (1 - coords[0])) |
| 1526 | + out = ax.scatter( |
| 1527 | + *coords, marker='.', c=ht_magnitude, cmap="viridis", norm=mcolors.LogNorm() |
| 1528 | + ) |
1531 | 1529 | clb = fig.colorbar(out) |
1532 | 1530 | clb.ax.set_title(r'$F_\mathrm{exp}\frac{1}{Q^2(1-x)}$') |
1533 | 1531 | ax.plot(*coords, label=key, markeredgewidth=1, markeredgecolor=None, **key_options[key]) |
|
0 commit comments