<jupyter_start><jupyter_text>Use seaborn defaults<jupyter_code>sns.set()
plt.plot(x,y)<jupyter_output><empty_output><jupyter_text>Styles Preset seaborn themes: darkgrid, whitegrid, dark, white, and ticks<jupyter_code>sns.set_style("ticks")
plt.plot(x,y)<jupyter_output><empty_output><jupyter_text>EXERCISETry the different styles  Customizing a style Styles can be adapted to suite your needs. Note that the values for the colors denote greyscale values.<jupyter_code>sns.axes_style("ticks")
sns.set_style("ticks",{'axes.spines.right':False})
plt.plot(x,y)<jupyter_output><empty_output><jupyter_text>EXERCISEAdapt the `ticks` style such that:* There are no spines on the right or the top* The text and labels are black* The y-ticks direct inwards* The axes grid is visible  Context Preset contexts: paper, notebook, talk, and poster<jupyter_code>sns.set_context("paper")
sns.set_style("ticks")
plt.plot(x,y)
sns.despine()<jupyter_output><empty_output><jupyter_text>EXERCISETry the different contexts  Customizing a context A context can be customized by setting the font scale, and using a similar dictionary as we used for the style:<jupyter_code>sns.set_context("paper",font_scale=2)
sns.set_style("ticks")
plt.plot(x,y)
sns.despine()
sns.plotting_context("paper")<jupyter_output><empty_output><jupyter_text>EXERCISECreate a paper style such that:* all font sizes are increased by 50%* the linewidth of all lines is 3* the major x and y ticks have a size of 2  Control figure settings for multiple plots 1. Create python file with default settings, e.g: `plotting_imports.py`<jupyter_code># create preset list of dashes, markers, and colors such that this is the same for all figures
dashes = [[],[3,3],[1,1],[3,3,1,3],[1,1,1,3,3,3],[1,1,1,1,1,3,3,3],[6,3,1,3],[3,3,3,3,1,3],[6,3,1,3,1,3]]
markers = ['o','s','v','p','8','D','>','^']
lcolors = ['k','r','g','y','b','grey','purple','brown']

# width in inches - match to medium
imw_max = 12
w_im = imw_max/4
h_im = 2.5

# seaborn settings
sns.set_context("notebook",font_scale=1.15,rc={'lines.linewidth' : 1.5})
sns.set_style('ticks',{'xtick.major.size' : 4,
                       'ytick.major.size' : 4,
                       'axes.spines.top' : False,
                       'axes.spines.right' : False})<jupyter_output><empty_output><jupyter_text>2. Import `plotting_imports.py` in python script / notebook<jupyter_code>fig,axes = plt.subplots(1,4,figsize=(4*w_im,h_im))
for ax in axes:
    ax.plot(x,y)
plt.tight_layout()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1463317384370016, 'fraction_numerical': 0.024322169059011165, 'mean_word_length': 6.0083798882681565, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 30, 'https://': 0, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '425199', 'license': 'MIT', 'n_tokens_mistral': 982, 'n_tokens_neox': 931, 'n_words': 217, 'path': 'workshop/Part 3 - Seaborn for aesthetics.ipynb', 'repo_name': 'pyladiesams/visualisation_sept2019', 'size': '2508'}