<jupyter_start><jupyter_text>Figure 4 - simulating data where a raincloud plot can reveal hidden distributional information.<jupyter_code>import matplotlib.pylab as plt
%matplotlib inline
import numpy as np
import os
import pandas as pd
import ptitprince as pt
import seaborn as sns
sns.set(style="whitegrid",font_scale=2)
x = (3.5+2*np.random.randn(1000, 2)); x1 = (-3.5+2*np.random.randn(1000, 2))
x=np.concatenate((x,x1),axis=0)
x_cat = np.random.randint(0,4,size=(2000, 1))
x=np.concatenate((x_cat,x),axis=1)
df_rand = pd.DataFrame(x, columns=['Category','A','B'])
# Make the figures directory if it doesn't yet exist
if not os.path.isdir('../figs/'):
    os.makedirs('../figs/')
fig, ax = plt.subplots(figsize=(12,11))

ax = pt.RainCloud(data = df_rand, x = "Category", y = "A",orient='h',bw=.1, ax=ax)
sns.despine()

fig.savefig('../figs/figure_4.jpg')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1768018018018018, 'fraction_numerical': 0.039414414414414414, 'mean_word_length': 5.786259541984733, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '98732', 'license': 'MIT', 'n_tokens_mistral': 375, 'n_tokens_neox': 356, 'n_words': 77, 'path': 'manuscript_code/figure4.ipynb', 'repo_name': 'TimVanMourik/RainCloudPlots', 'size': '888'}