I have problem with numbering subsection after figure label. I put appendix, caption and label, and put counter of figure to 0 so graph label says Picture 1. Then, when i want to start new chapter, section or subsection, it is numbered .0.1. instead of example, 2.2.1. How do i end figure labeling and let document continue section numbering normally? Here is the code:


\begin{axis}[xlabel=x,ylabel=y,grid=both,xmax=10,ymax=10,axis lines=middle,restrict y to domain=-7:10,enlargelimits]
\addplot[blue]  {pow(2,x)} node[above]{$y=2^x$};
\addplot[red]  {pow(10,x)} node[above]{$y=10^x$};


  • What is your over all goal doing this? Why is there an \appendix-Tag in the middle of your figure?
    – nhck
    Aug 2, 2017 at 9:30
  • @nhck I have a section 2.2. In there i need to put a graph of an exponential function. This is my first picture in document so i need to label it: "Picture 1: Exponential graph". If i just use caption and label, it's label isn't "1." but "2.1" for some reason. If i put \appendix and set counter to 0, it shows correct number of caption but messes up section numbering. It may be a minor problem, i just started working in tex yesterday, so I only put appendix in because it worked that way, I cant really understand what it does.
    – Mactadilis
    Aug 2, 2017 at 10:12

1 Answer 1


The numbering depends on your documentclass. I'm assuming book in this example. You can use the package chngcntr to adjust the figure numbering to include or exclude certain numbers. The example below excludes section and subsection number for the figure number.

The \appendixtag you use is just for resetting the counter to start the appendix numbering.

These two posts are also a good read for you: How to number figures continuously in documentclass{article} and Why does an environment's label have to appear after the caption?

\usepackage{lipsum} %Just for the sampletext

\usepackage[demo]{graphicx} %Package for the Figures

\usepackage{chngcntr} %Package to set the counter

\chapter{This is Chapter}
\section{Section One}
\section{Section Two}

\subsection{Subsection of Section Two}

\appendix %This changes the counter for the appendix
\section{Section One}
  • 1
    Thank you, it solved the problem. I deleted appendix and set counter within figure, added \usepackage{chngcntr} and added \counterwithout command.
    – Mactadilis
    Aug 2, 2017 at 12:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .