Matplotlib Scatterplots, but with Emojis as Markers
I wrote a function to create scatterplots using emojis as markers to support some analysis & visualization I'm doing for a (very silly) side project. After a good bit of research (I was pretty shocked this didn't exist already), I built this based on [this article](https://towardsdatascience.com/how-i-got-matplotlib-to-plot-apple-color-emojis-c983767b39e0), but adapted to produce a scatterplot instead of a bar chart.
#function to create a scatterplot with emojis as markers
#based on https://towardsdatascience.com/how-i-got-matplotlib-to-plot-apple-color-emojis-c983767b39e0
#follow instructions above to install & build mplcairo
#Set the backend to use mplcairo
import matplotlib, mplcairo
print('Default backend: ' + matplotlib.get_backend())
matplotlib.use("module://mplcairo.macosx")
print('Backend is now ' + matplotlib.get_backend())
# IMPORTANT: Import these libraries only AFTER setting the backend
import matplotlib.pyplot as plt, numpy as np
from matplotlib.font_manager import FontProperties
# Load Apple Color Emoji font
prop = FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc')
# Load Apple Color Emoji font
prop =
/r/Python
https://redd.it/iazdqd
I wrote a function to create scatterplots using emojis as markers to support some analysis & visualization I'm doing for a (very silly) side project. After a good bit of research (I was pretty shocked this didn't exist already), I built this based on [this article](https://towardsdatascience.com/how-i-got-matplotlib-to-plot-apple-color-emojis-c983767b39e0), but adapted to produce a scatterplot instead of a bar chart.
#function to create a scatterplot with emojis as markers
#based on https://towardsdatascience.com/how-i-got-matplotlib-to-plot-apple-color-emojis-c983767b39e0
#follow instructions above to install & build mplcairo
#Set the backend to use mplcairo
import matplotlib, mplcairo
print('Default backend: ' + matplotlib.get_backend())
matplotlib.use("module://mplcairo.macosx")
print('Backend is now ' + matplotlib.get_backend())
# IMPORTANT: Import these libraries only AFTER setting the backend
import matplotlib.pyplot as plt, numpy as np
from matplotlib.font_manager import FontProperties
# Load Apple Color Emoji font
prop = FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc')
# Load Apple Color Emoji font
prop =
/r/Python
https://redd.it/iazdqd
Medium
How I got Matplotlib to plot Apple Color Emojis
And why the library currently cannot
Video Understanding if name == 'main' in Python in 2 Minutes
In this quick 2-minute video, we'll demystify a fundamental concept in Python programming that's often a source of confusion for newcomers and even some experienced developers.
We'll explore the purpose and practical application of the if __name__ == '__main__' construct in Python scripts. No jargon, just clear explanations to help you gain a solid understanding of how this simple line of code can make your Python scripts more organized and versatile.
Video Link: https://youtu.be/WfPwvUjIZtE?si=ODo0DYZq51s\_nVct
If you have any suggestions or feedback, then don't hesitate.
/r/Python
https://redd.it/17rflks
In this quick 2-minute video, we'll demystify a fundamental concept in Python programming that's often a source of confusion for newcomers and even some experienced developers.
We'll explore the purpose and practical application of the if __name__ == '__main__' construct in Python scripts. No jargon, just clear explanations to help you gain a solid understanding of how this simple line of code can make your Python scripts more organized and versatile.
Video Link: https://youtu.be/WfPwvUjIZtE?si=ODo0DYZq51s\_nVct
If you have any suggestions or feedback, then don't hesitate.
/r/Python
https://redd.it/17rflks
YouTube
Understanding if __name__ == '__main__' in Python | 2MinutesPy
#if__name__=='__main__' #script #python #pythonprogramming #function #2minutespy
🖐Hey, want to know about if __name__ == '__main__' in Python? In this Python tutorial, we dive into a fundamental concept: if __name__ == '__main__' in Python.
In this quick…
🖐Hey, want to know about if __name__ == '__main__' in Python? In this Python tutorial, we dive into a fundamental concept: if __name__ == '__main__' in Python.
In this quick…