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:

agg.path.chunksize: 0
animation.avconv_args: []
animation.avconv_path: avconv
animation.bitrate: -1
animation.codec: mpeg4
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.axisbelow: False
axes.edgecolor: k
axes.facecolor: w
axes.formatter.limits: [-7, 7]
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: True
axes.labelcolor: k
axes.labelpad: 5.0
axes.labelsize: medium
axes.labelweight: normal
axes.linewidth: 1.0
axes.prop_cycle: cycler('color', ['b', 'g', 'r', 'c', 'm', 'y', 'k'])
axes.spines.bottom: True
axes.spines.left: True
axes.spines.right: True
axes.spines.top: True
axes.titlesize: large
axes.titleweight: normal
axes.unicode_minus: True
axes.xmargin: 0.0
axes.ymargin: 0.0
axes3d.grid: True
backend: agg
backend.qt4: PyQt4
backend.qt5: PyQt5
backend_fallback: True
boxplot.bootstrap: None
boxplot.boxprops.color: b
boxplot.boxprops.linestyle: -
boxplot.boxprops.linewidth: 1.0
boxplot.capprops.color: k
boxplot.capprops.linestyle: -
boxplot.capprops.linewidth: 1.0
boxplot.flierprops.color: b
boxplot.flierprops.linestyle: none
boxplot.flierprops.linewidth: 1.0
boxplot.flierprops.marker: +
boxplot.flierprops.markeredgecolor: k
boxplot.flierprops.markerfacecolor: b
boxplot.flierprops.markersize: 6.0
boxplot.meanline: False
boxplot.meanprops.color: r
boxplot.meanprops.linestyle: -
boxplot.meanprops.linewidth: 1.0
boxplot.medianprops.color: r
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: b
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
docstring.hardcopy: False
errorbar.capsize: 3.0
examples.directory:
figure.autolayout: False
figure.dpi: 80.0
figure.edgecolor: w
figure.facecolor: 0.75
figure.figsize: [8.0, 6.0]
figure.frameon: True
figure.max_open_warning: 20
figure.subplot.bottom: 0.1
figure.subplot.hspace: 0.2
figure.subplot.left: 0.125
figure.subplot.right: 0.9
figure.subplot.top: 0.9
figure.subplot.wspace: 0.2
figure.titlesize: medium
figure.titleweight: normal
font.cursive: ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'Script MT', 'Felipa', 'cursive']
font.family: ['monospace']
font.fantasy: ['Comic Sans MS', 'Chicago', 'Charcoal', 'ImpactWestern', 'Humor Sans', 'fantasy']
font.monospace: ['DejaVu Sans Mono']
font.sans-serif: ['Bitstream Vera Sans', 'DejaVu Sans', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']
font.serif: ['Bitstream Vera Serif', 'DejaVu Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif']
font.size: 20.0
font.stretch: normal
font.style: normal
font.variant: normal
font.weight: normal
grid.alpha: 1.0
grid.color: k
grid.linestyle: :
grid.linewidth: 0.5
image.aspect: equal
image.cmap: jet
image.composite_image: True
image.interpolation: bilinear
image.lut: 256
image.origin: upper
image.resample: False
interactive: False
keymap.all_axes: ['a']
keymap.back: ['left', 'c', 'backspace']
keymap.forward: ['right', 'v']
keymap.fullscreen: ['f', 'ctrl+f']
keymap.grid: ['g']
keymap.home: ['h', 'r', 'home']
keymap.pan: ['p']
keymap.quit: ['ctrl+w', 'cmd+w']
keymap.save: ['s', 'ctrl+s']
keymap.xscale: ['k', 'L']
keymap.yscale: ['l']
keymap.zoom: ['o']
legend.borderaxespad: 0.5
legend.borderpad: 0.4
legend.columnspacing: 2.0
legend.edgecolor: inherit
legend.facecolor: inherit
legend.fancybox: False
legend.fontsize: large
legend.framealpha: None
legend.frameon: True
legend.handleheight: 0.7
legend.handlelength: 2.0
legend.handletextpad: 0.8
legend.isaxes: True
legend.labelspacing: 0.5
legend.loc: upper right
legend.markerscale: 1.0
legend.numpoints: 2
legend.scatterpoints: 3
legend.shadow: False
lines.antialiased: True
lines.color: b
lines.dash_capstyle: butt
lines.dash_joinstyle: round
lines.linestyle: -
lines.linewidth: 1.0
lines.marker: None
lines.markeredgewidth: 0.5
lines.markersize: 6.0
lines.solid_capstyle: projecting
lines.solid_joinstyle: round
markers.fillstyle: full
mathtext.bf: serif:bold
mathtext.cal: cursive
mathtext.default: it
mathtext.fallback_to_cm: True
mathtext.fontset: cm
mathtext.it: serif:italic
mathtext.rm: serif
mathtext.sf: sans\-serif
mathtext.tt: monospace
nbagg.transparent: True
patch.antialiased: True
patch.edgecolor: k
patch.facecolor: b
patch.linewidth: 1.0
path.effects: []
path.simplify: True
path.simplify_threshold: 0.1111111111111111
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: 100.0
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
svg.fonttype: path
svg.image_inline: True
svg.image_noscale: False
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.color: k
xtick.direction: in
xtick.labelsize: medium
xtick.major.pad: 4.0
xtick.major.size: 4.0
xtick.major.width: 0.5
xtick.minor.pad: 4.0
xtick.minor.size: 2.0
xtick.minor.visible: False
xtick.minor.width: 0.5
ytick.color: k
ytick.direction: in
ytick.labelsize: medium
ytick.major.pad: 4.0
ytick.major.size: 4.0
ytick.major.width: 0.5
ytick.minor.pad: 4.0
ytick.minor.size: 2.0
ytick.minor.visible: False
ytick.minor.width: 0.5

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

Gallery generated by Sphinx-Gallery