Category Archives: Figures

women/men ratio in Barcelona

A choropleth map of Barcelona showing the women/men ratio in every census sections. Red shows low ratios while green shows high ratios.


p1a2 stripe symmetry groups

p1m1 stripe symmetry groups

p112 stripe symmetry groups

p111 stripe symmetry groups

figures from ggplot2 to pictex

The ggplot2 R package recognises the tex extension and it allows to export the data graphics to latex documents. The tex output doesn’t look like the original file but with a little code editing we can get a quite good figure. Here is an example of the original and the exported line graphic once retouched.


disp <− qplot(date, unemploy / pop, data = economics, geom = "line")
disp + theme(panel.grid.major = element_line(colour = "white"), panel.border = element_rect(colour = NA))
ggsave(filename = "graf_lin.tex", scale=2, width = 10, height = 5, units = "cm", dpi = 300)


text rendering with LaTeX in matplotlib

Matplotlib has the option to use LaTeX to manage all text layout.

The LaTeX option is activated by setting “text.usetex: True” in the rc settings. Text handling with matplotlib’s LaTeX support is slower than matplotlib’s very capable mathtext, but is more flexible, since different LaTeX packages (font packages, math packages, etc.) can be used.


The code of this figure is as simple as:

import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt

mpl.rcParams['legend.fontsize'] = 14
plt.rc('text', usetex=True)
plt.rc('font', family='serif')

fig = plt.figure()
ax = fig.gca(projection='3d')
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-4, 4, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)
ax.plot(x, y, z, label='$Parametric$ $curve$', alpha=0.8)
ax.legend(numpoints=1, loc=1, frameon=False)

basic structures with structuralanalysis package

Some simple structures that can be drawn with the structuralanalysis package from Graz University of Technology. I’ve been drawing these examples that can be found in Prontuario Ensidesa.






testing table insertion

Here I reproduce a table from Paola Galbany’s thesis to test the capabilities of QuickLaTeX with tables.

Rendered by

some more textile tiles

Rendered by