# Styles Every plot and figure of the package can be drawn in another **style**: with more or less detail, with other colours, and with the fonts and lines of a paper. The images on this page are drawn from the sample data by the current code every time the documentation is built. ## The three styles | Style | Detail | Colours | Matplotlib settings | |---|---|---|---| | `"report"` (default) | Titles, legends and reference lines, as in the daily reports. | default | the sizes of the daily reports | | `"publication"` | Only the data: no titles, no helper text (corner labels, explanations); the caption says it. | colour-blind safe | 7 pt Arial, thin lines, text kept editable in pdf and svg, 300 dpi | | `"full"` | Also the numbers behind each point: trials of each point and bar, fitted parameters. | default | the sizes of the daily reports | ```python from lecilab_behavior_analysis.figures import session_summary, subject_progress from lecilab_behavior_analysis.style import set_style, use_style fig, _ = session_summary(day, style="publication") # one figure set_style("publication") # every plot from now on set_style("report") # back to the default with use_style("full"): # only inside the block fig, _ = subject_progress(trials) ``` The same day (a session summary) in each style: **report** ![report](_static/examples/style_report.png) **publication** ![publication](_static/examples/style_publication.png) **full** ![full](_static/examples/style_full.png) ## Colours Colours are given by meaning, so that the same thing has the same colour in every plot: correct and incorrect, left and right, repeat and alternate, each stimulus modality, reaction time and time between trials... **Each training stage has the colour of its modality**, lighter for easy and darker for hard (habituation and manual training have their own), in every mouse and figure. Three palettes: `"default"`, `"colorblind"` (Okabe & Ito) and `"grayscale"`. Any style can take any palette, and any colour can be changed: ```python set_style("report", palette="colorblind") set_style("publication", palette="grayscale") set_style("report", colors={"correct": "green", "visual": "purple", "TwoAFC_visual_hard": "black"}) ``` The names of the colours are in `style.DEFAULT_COLORS`; modalities and training stages can be given by name too. The cohort of the sample data in each palette: **default** ![default palette](_static/examples/palette_default.png) **colorblind** ![colorblind palette](_static/examples/palette_colorblind.png) **grayscale** ![grayscale palette](_static/examples/palette_grayscale.png) ## In your own plots The plots read the active style, so a plot of your own can use it too: ```python from lecilab_behavior_analysis.style import color, shows, stage_color, title ax.plot(x, y, color=color("correct")) ax.bar(days, trials, color=[stage_color(s) for s in stages]) title(ax, "My plot") # no title in publication if shows("full"): ax.text(0.9, 0.1, f"n = {len(df)}", transform=ax.transAxes) ``` The old `figure_styles.figure_style_guido()` is now `figure_style_publication()` (the old name still works): it sets the publication style.