Total Complexity | 2 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """ |
||
2 | Plots. |
||
3 | """ |
||
4 | from collections import Mapping |
||
5 | from dataclasses import dataclass |
||
6 | |||
7 | import seaborn as sns |
||
8 | from matplotlib.axes import Axes |
||
9 | from matplotlib.figure import Figure |
||
10 | |||
11 | from mandos.analysis.concordance import ConcordanceDf |
||
12 | |||
13 | |||
14 | @dataclass(frozen=True, repr=True) |
||
15 | class HeatmapPlotter: |
||
16 | vmin: float = 0 |
||
17 | vmax: float = 1 |
||
18 | |||
19 | def plot(self, ax: Axes) -> Axes: |
||
20 | ax.pcolormesh() |
||
21 | return ax |
||
22 | |||
23 | |||
24 | class ViolinPlotter: |
||
25 | def plot(self, concordance: ConcordanceDf) -> Axes: |
||
26 | palette = sns.color_palette(["#0000c0", "#888888"]) |
||
27 | return sns.violinplot( |
||
28 | data=concordance, |
||
29 | x="psi", |
||
30 | y="score", |
||
31 | hue="phi", |
||
32 | split=True, |
||
33 | scale_hue=False, |
||
34 | palette=palette, |
||
35 | ) |
||
36 |