Using Unicode everywhere 🤗

This examples includes unicode characters, mostly emoji 🎉 to stress test the build and test environments that parse the example files.

from __future__ import unicode_literals

# 🎉 👍
# Code source: Óscar Nájera
# License: BSD 3 clause

import numpy as np
import matplotlib.pyplot as plt

plt.rcParams['font.size'] = 20
plt.rcParams["font.monospace"] = ["DejaVu Sans Mono"]
plt.rcParams["font.family"] = "monospace"

plt.figure()
x = np.random.randn(100) * 2 + 1
y = np.random.randn(100) * 6 + 3
s = np.random.rand(*x.shape) * 800 + 500
plt.scatter(x, y, s, marker=r'$\oint$')
x = np.random.randn(60) * 7 - 4
y = np.random.randn(60) * 3 - 2
plt.scatter(x, y, s, alpha=0.5, c='g', marker=r'$\clubsuit$')
plt.xlabel('⇒')
plt.ylabel('⇒')
plt.title('♲' * 10)
print('Std out capture 😎')
plt.show()
../_images/sphx_glr_plot_unicode_everywhere_001.png

Out:

Std out capture 😎

Debug fonts

print(plt.rcParams)

Out:

_internal.classic_mode: False
agg.path.chunksize: 0
animation.avconv_args: []
animation.avconv_path: avconv
animation.bitrate: -1
animation.codec: h264
animation.convert_args: []
animation.convert_path: convert
animation.ffmpeg_args: []
animation.ffmpeg_path: ffmpeg
animation.frame_format: png
animation.html: none
animation.mencoder_args: []
animation.mencoder_path: mencoder
animation.writer: ffmpeg
axes.autolimit_mode: data
axes.axisbelow: line
axes.edgecolor: k
axes.facecolor: w
axes.formatter.limits: [-7, 7]
axes.formatter.offset_threshold: 4
axes.formatter.use_locale: False
axes.formatter.use_mathtext: False
axes.formatter.useoffset: True
axes.grid: False
axes.grid.axis: both
axes.grid.which: major
axes.hold: None
axes.labelcolor: k
axes.labelpad: 4.0
axes.labelsize: medium
axes.labelweight: normal
axes.linewidth: 0.8
axes.prop_cycle: cycler(u'color', [u'#1f77b4', u'#ff7f0e', u'#2ca02c', u'#d62728', u'#9467bd', u'#8c564b', u'#e377c2', u'#7f7f7f', u'#bcbd22', u'#17becf'])
axes.spines.bottom: True
axes.spines.left: True
axes.spines.right: True
axes.spines.top: True
axes.titlepad: 6.0
axes.titlesize: large
axes.titleweight: normal
axes.unicode_minus: True
axes.xmargin: 0.05
axes.ymargin: 0.05
axes3d.grid: True
backend: agg
backend.qt4: PyQt4
backend.qt5: PyQt5
backend_fallback: True
boxplot.bootstrap: None
boxplot.boxprops.color: k
boxplot.boxprops.linestyle: -
boxplot.boxprops.linewidth: 1.0
boxplot.capprops.color: k
boxplot.capprops.linestyle: -
boxplot.capprops.linewidth: 1.0
boxplot.flierprops.color: k
boxplot.flierprops.linestyle: none
boxplot.flierprops.linewidth: 1.0
boxplot.flierprops.marker: o
boxplot.flierprops.markeredgecolor: k
boxplot.flierprops.markerfacecolor: none
boxplot.flierprops.markersize: 6.0
boxplot.meanline: False
boxplot.meanprops.color: C2
boxplot.meanprops.linestyle: --
boxplot.meanprops.linewidth: 1.0
boxplot.meanprops.marker: ^
boxplot.meanprops.markeredgecolor: C2
boxplot.meanprops.markerfacecolor: C2
boxplot.meanprops.markersize: 6.0
boxplot.medianprops.color: C1
boxplot.medianprops.linestyle: -
boxplot.medianprops.linewidth: 1.0
boxplot.notch: False
boxplot.patchartist: False
boxplot.showbox: True
boxplot.showcaps: True
boxplot.showfliers: True
boxplot.showmeans: False
boxplot.vertical: True
boxplot.whiskerprops.color: k
boxplot.whiskerprops.linestyle: -
boxplot.whiskerprops.linewidth: 1.0
boxplot.whiskers: 1.5
contour.corner_mask: True
contour.negative_linestyle: dashed
datapath: /usr/share/matplotlib/mpl-data
date.autoformatter.day: %Y-%m-%d
date.autoformatter.hour: %m-%d %H
date.autoformatter.microsecond: %M:%S.%f
date.autoformatter.minute: %d %H:%M
date.autoformatter.month: %Y-%m
date.autoformatter.second: %H:%M:%S
date.autoformatter.year: %Y
docstring.hardcopy: False
errorbar.capsize: 0.0
examples.directory:
figure.autolayout: False
figure.dpi: 100.0
figure.edgecolor: w
figure.facecolor: w
figure.figsize: [6.4, 4.8]
figure.frameon: True
figure.max_open_warning: 20
figure.subplot.bottom: 0.11
figure.subplot.hspace: 0.2
figure.subplot.left: 0.125
figure.subplot.right: 0.9
figure.subplot.top: 0.88
figure.subplot.wspace: 0.2
figure.titlesize: large
figure.titleweight: normal
font.cursive: [u'Apple Chancery', u'Textile', u'Zapf Chancery', u'Sand', u'Script MT', u'Felipa', u'cursive']
font.family: [u'monospace']
font.fantasy: [u'Comic Sans MS', u'Chicago', u'Charcoal', u'ImpactWestern', u'Humor Sans', u'xkcd', u'fantasy']
font.monospace: [u'DejaVu Sans Mono']
font.sans-serif: [u'DejaVu Sans', u'Bitstream Vera Sans', u'Computer Modern Sans Serif', u'Lucida Grande', u'Verdana', u'Geneva', u'Lucid', u'Arial', u'Helvetica', u'Avant Garde', u'sans-serif']
font.serif: [u'DejaVu Serif', u'Bitstream Vera Serif', u'Computer Modern Roman', u'New Century Schoolbook', u'Century Schoolbook L', u'Utopia', u'ITC Bookman', u'Bookman', u'Nimbus Roman No9 L', u'Times New Roman', u'Times', u'Palatino', u'Charter', u'serif']
font.size: 20.0
font.stretch: normal
font.style: normal
font.variant: normal
font.weight: normal
grid.alpha: 1.0
grid.color: #b0b0b0
grid.linestyle: -
grid.linewidth: 0.8
hatch.color: k
hatch.linewidth: 1.0
hist.bins: 10
image.aspect: equal
image.cmap: viridis
image.composite_image: True
image.interpolation: nearest
image.lut: 256
image.origin: upper
image.resample: True
interactive: False
keymap.all_axes: [u'a']
keymap.back: [u'left', u'c', u'backspace']
keymap.forward: [u'right', u'v']
keymap.fullscreen: [u'f', u'ctrl+f']
keymap.grid: [u'g']
keymap.home: [u'h', u'r', u'home']
keymap.pan: [u'p']
keymap.quit: [u'ctrl+w', u'cmd+w']
keymap.save: [u's', u'ctrl+s']
keymap.xscale: [u'k', u'L']
keymap.yscale: [u'l']
keymap.zoom: [u'o']
legend.borderaxespad: 0.5
legend.borderpad: 0.4
legend.columnspacing: 2.0
legend.edgecolor: 0.8
legend.facecolor: inherit
legend.fancybox: True
legend.fontsize: medium
legend.framealpha: 0.8
legend.frameon: True
legend.handleheight: 0.7
legend.handlelength: 2.0
legend.handletextpad: 0.8
legend.labelspacing: 0.5
legend.loc: best
legend.markerscale: 1.0
legend.numpoints: 1
legend.scatterpoints: 1
legend.shadow: False
lines.antialiased: True
lines.color: C0
lines.dash_capstyle: butt
lines.dash_joinstyle: round
lines.dashdot_pattern: [4.8, 1.2, 0.8, 1.2]
lines.dashed_pattern: [2.8, 1.2]
lines.dotted_pattern: [1.1, 1.1]
lines.linestyle: -
lines.linewidth: 1.5
lines.marker: None
lines.markeredgewidth: 1.0
lines.markersize: 6.0
lines.scale_dashes: True
lines.solid_capstyle: projecting
lines.solid_joinstyle: round
markers.fillstyle: full
mathtext.bf: sans:bold
mathtext.cal: cursive
mathtext.default: it
mathtext.fallback_to_cm: True
mathtext.fontset: dejavusans
mathtext.it: sans:italic
mathtext.rm: sans
mathtext.sf: sans
mathtext.tt: monospace
nbagg.transparent: True
patch.antialiased: True
patch.edgecolor: k
patch.facecolor: C0
patch.force_edgecolor: False
patch.linewidth: 1.0
path.effects: []
path.simplify: True
path.simplify_threshold: 0.111111111111
path.sketch: None
path.snap: True
pdf.compression: 6
pdf.fonttype: 3
pdf.inheritcolor: False
pdf.use14corefonts: False
pgf.debug: False
pgf.preamble: []
pgf.rcfonts: True
pgf.texsystem: xelatex
plugins.directory: .matplotlib_plugins
polaraxes.grid: True
ps.distiller.res: 6000
ps.fonttype: 3
ps.papersize: letter
ps.useafm: False
ps.usedistiller: False
savefig.bbox: None
savefig.directory: ~
savefig.dpi: figure
savefig.edgecolor: w
savefig.facecolor: w
savefig.format: png
savefig.frameon: True
savefig.jpeg_quality: 95
savefig.orientation: portrait
savefig.pad_inches: 0.1
savefig.transparent: False
scatter.marker: o
svg.fonttype: path
svg.hashsalt: None
svg.image_inline: True
text.antialiased: True
text.color: k
text.dvipnghack: None
text.hinting: auto
text.hinting_factor: 8
text.latex.preamble: []
text.latex.preview: False
text.latex.unicode: False
text.usetex: False
timezone: UTC
tk.window_focus: False
toolbar: toolbar2
verbose.fileo: sys.stdout
verbose.level: silent
webagg.open_in_browser: True
webagg.port: 8988
webagg.port_retries: 50
xtick.bottom: True
xtick.color: k
xtick.direction: out
xtick.labelsize: medium
xtick.major.bottom: True
xtick.major.pad: 3.5
xtick.major.size: 3.5
xtick.major.top: True
xtick.major.width: 0.8
xtick.minor.bottom: True
xtick.minor.pad: 3.4
xtick.minor.size: 2.0
xtick.minor.top: True
xtick.minor.visible: False
xtick.minor.width: 0.6
xtick.top: False
ytick.color: k
ytick.direction: out
ytick.labelsize: medium
ytick.left: True
ytick.major.left: True
ytick.major.pad: 3.5
ytick.major.right: True
ytick.major.size: 3.5
ytick.major.width: 0.8
ytick.minor.left: True
ytick.minor.pad: 3.4
ytick.minor.right: True
ytick.minor.size: 2.0
ytick.minor.visible: False
ytick.minor.width: 0.6
ytick.right: False

Total running time of the script: ( 0 minutes 0.067 seconds)

Gallery generated by Sphinx-Gallery