TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Below is an excerpt from my thesis, showing a figure with a caption.

I'd like to give the figure a title too, that is, a few words written above the figure.

Can I do that in latex? If so, how?

enter image description here

share|improve this question
Did you create the plot with matplotlib? Then you could also add a title there, though the font wouldn't match the document font. – Torbjørn T. Aug 14 '13 at 11:42
Yes, that's why I did not include one there. The fonts did not match and it all became so tacky. – The Unfun Cat Aug 14 '13 at 11:44
The fonts don't match on your axis scales either (and presumably your axis labels) - your are labelling your axes I assume? I've just been testing an alternative approach for my thesis - see my answer below. – Chris H Aug 15 '13 at 11:51
up vote 14 down vote accepted

The {figure} environment isn't limited to contain only figures etc. You can add anything so just type in your title above the figure.


    \textbf{Your title}\par\medskip
    \caption{Your caption}

You can define a new command like \figuretitle to make the formatting and spacing consistent.

    {\centering%   <--------  will only affect the title because of the grouping (by the
    \textbf{#1}%              braces before \centering and behind \medskip). If you remove
    \par\medskip}%            these braces the whole body of a {figure} env will be centered.

Looks the same as above, but can be used as

    \figuretitle{Your title}
    \caption{Your caption}

Or you can use the \caption above the figure. In this case you may use the caption package to adjust the spacing.

caption above




    \caption{Your caption}
share|improve this answer
Thanks. Ps. for other newbs: \newcommands should be inserted in your config-file to get it to work in every chapter. In my case this is classicthesis-config.tex. – The Unfun Cat Aug 14 '13 at 11:54
This is not wrong but neither correct ;-) You can place the definition anywhere in sour document and use it frome there on. It is common sense to put definition in the preamble, i.e. the part before `\begin{document}, and the definition is scoped by a group, e.g. An environment ... – Tobi Aug 14 '13 at 13:06
Thanks. Right. Classicthesis has even included a space in the preamble for this. Ps. I guess the \centering does not need to be included when you use the \figuretitle? – The Unfun Cat Aug 15 '13 at 7:03
@TheUnfunCat: Yes the \centering is kind of redundant in this case, but I used a group, i.e. a pair of braces {}, so \centering will only affect the title and not the image. If you want to center all images I’d do it globally, see tex.stackexchange.com/q/6033/4918. – Tobi Aug 15 '13 at 10:47

You could try making the matplotlib text look like LaTeX:

%matplotlib inline
from matplotlib import pyplot as plt

# This is the first important line:
from matplotlib import rcParams

plt.plot([1, 2, 3, 4], 
         [2, 4, 6, 8])

# These are the second and third important lines:
plt.rc('text', usetex=True)
plt.rc('font', family='serif')

# Change the fontsize to match your document.
plt.xlabel("This is a cool label.", fontsize=12)
plt.ylabel("This is another cool label.", fontsize=12)
plt.savefig("image.pdf", dpi=200)

LaTeX Style Fonts from matplotlib!

share|improve this answer
I found these two web pages very useful to produce the plots of my thesis with Matplotlib: wiki.scipy.org/Cookbook/Matplotlib/LaTeX_Examples and wiki.scipy.org/Cookbook/Matplotlib/UsingTex . However I would not do it again; instead I would let LaTeX produce the plots itself (see ticz package for instance). Advantages: (1) actually looks like LaTeX; (2) fix typos, resize and restyle without having to rerun your 4-years-old python code and (3) no need to deal with Matplotlib's maddening API and documentation. – Niriel May 22 '15 at 11:04

An alternative method is to output from Matplotlib as .svg, with or without a title then read in to Inkscape. You can save from Inkscape as .pdf+.tex (or .eps+.tex I think), where the .pdf(.eps) contains the graphics, and the .tex overlays the text, in your current document font. All this can be done from the command line - Inkscape supports that.

A couple of links:

Setting up matplotlib to output text as text

Adjusting sizing of figure and text

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.