<jupyter_start><jupyter_text>Charts<jupyter_code>import matplotlib.pyplot as plt
import io


pie_charts_data = zip(data.consonants, data.vowels)

fig = plt.figure(figsize=(0.5, 0.5))
fig.patch.set_alpha(0)
ax = fig.add_subplot(111)
plots = []
for sizes in pie_charts_data:
    ax.pie(sizes, colors=('#e6194b', '#19e6b4'))
    buff = io.StringIO()
    plt.savefig(buff, format='SVG')
    buff.seek(0)
    svg = buff.read()
    svg = svg.replace('\n', '')
    plots.append(svg)
    plt.cla()
plt.clf()
plt.close()<jupyter_output><empty_output><jupyter_text>Legend<jupyter_code>import branca


legend_html = '''
{% macro html(this, kwargs) %}
<div style="
    position: fixed; 
    bottom: 50px;
    left: 50px;
    width: 250px;
    height: 80px;
    z-index:9999;
    font-size:14px;
    ">
    <p><a style="color:#e6194b;font-size:150%;margin-left:20px;">◼</a>&emsp;Consonants</p>
    <p><a style="color:#19e6b4;font-size:150%;margin-left:20px;">◼</a>&emsp;Vowels</p>
</div>
<div style="
    position: fixed; 
    bottom: 50px;
    left: 50px;
    width: 150px;
    height: 80px; 
    z-index:9998;
    font-size:14px;
    background-color: #ffffff;
    filter: blur(8px);
    -webkit-filter: blur(8px);
    opacity: 0.7;
    ">
</div>
{% endmacro %}
'''

legend = branca.element.MacroElement()
legend._template = branca.element.Template(legend_html)<jupyter_output><empty_output><jupyter_text>Map<jupyter_code>m = folium.Map(location=(0,0), zoom_start=2)

for i, coord in enumerate(data.coordinates):
    marker = folium.Marker(coord)
    icon = folium.DivIcon(html=plots[i])
    marker.add_child(icon)
    popup = folium.Popup(
        'Consonants: {}<br>\nVowels: {}'.format(data.consonants[i], data.vowels[i])
    )
    marker.add_child(popup)
    m.add_child(marker)
m.get_root().add_child(legend)
m<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17502726281352235, 'fraction_numerical': 0.03925845147219193, 'mean_word_length': 4.125698324022347, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '117930', 'license': 'MIT', 'n_tokens_mistral': 818, 'n_tokens_neox': 748, 'n_words': 110, 'path': 'examples/Minicharts.ipynb', 'repo_name': 'artnikitin/folium', 'size': '1834'}