<jupyter_start><jupyter_text>Plotting styleRelevant links:* http://seaborn.pydata.org/tutorial/aesthetics.html* https://seaborn.pydata.org/generated/seaborn.catplot.html* https://seaborn.pydata.org/generated/seaborn.barplot.html<jupyter_code>from rics.utility import configure_stuff

configure_stuff()
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns<jupyter_output><empty_output><jupyter_text>Plain plots (using plt)<jupyter_code>def sinplot(flip=1):
    x = np.linspace(0, 14, 100)
    for i in range(1, 7):
        plt.plot(x, np.sin(x + i * 0.5) * (7 - i) * flip)
    plt.suptitle("Suptitle")
sinplot()<jupyter_output><empty_output><jupyter_text>Seaborn: Barplot<jupyter_code>tips = sns.load_dataset("tips")
sns.barplot(x="day", y="total_bill", data=tips).set_title("Tips");<jupyter_output><empty_output><jupyter_text>Seaborn: Catplot<jupyter_code>titanic = sns.load_dataset("titanic")
# No use "partialing" catplot since it breaks too easily depending on user preferences. There's no foolproof way to set
# a figsize either without doing some really hacky stuff
g = sns.catplot(x="who", y="survived", col="class", row="alone", data=titanic, kind="bar")

(
    g.set_axis_labels("", "Survival Rate\n{row_var}: {row_name}")  # Row/col vars don't seem to work here
    .set_xticklabels(["Men", "Women", "Children"])
    .set_titles("{col_name} {col_var}\n{row_var}: {row_name}")
    .set(ylim=(0, 1))
    .despine(left=True)
)


g.fig.suptitle("Titanic")
g.fig.set_size_inches((20, 8))
g.fig.tight_layout()  # Figure title overlaps with subplot titles without this

from matplotlib.ticker import PercentFormatter

percent_formatter = PercentFormatter()
for ax in g.axes.flatten():
    ax.yaxis.set_major_formatter(percent_formatter)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1426991150442478, 'fraction_numerical': 0.009402654867256638, 'mean_word_length': 6.038910505836576, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '530471', 'license': 'MIT', 'n_tokens_mistral': 710, 'n_tokens_neox': 678, 'n_words': 133, 'path': 'jupyterlab/demo/plotting/Style.ipynb', 'repo_name': 'rsundqvist/rics', 'size': '1808'}