# Why my figure is not appearing? [duplicate]

This question already has an answer here:

Could someone please explain to me why the figure in my code is not appearing when I compile the code thanks.

MY CODE:

\documentclass{article}
\usepackage{tikz,hyperref,multicol,lipsum,geometry,titlesec,fancyhdr,amsmath,MnSymbol,wasysym,fleqn}%
\fancyhf{}% Clear all headers/footers
\renewcommand{\footrulewidth}{0.4pt}% No footer rule
\fancyfoot[L]{*\href{myemail}{\emph{myemail}}}%

\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}

\geometry{margin=1in}

\title{Title}
\author{\textbf{myname}*}

\begin{document}
\maketitle

\begin{abstract}
Abstract
\end{abstract}

\begin{multicols}{2}
\thispagestyle{fancy}%

\section{Introdution}

some writing

\begin{figure}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$\mu(x)$
]
% invoke external gnuplot as
% calculator:
\end{axis}
\end{tikzpicture}

\end{figure}

some writing

\end{multicols}

\end{document}


## marked as duplicate by Gonzalo Medina, Paul Gessler, barbara beeton, ChrisS, Adam LiterFeb 17 '15 at 3:42

• Your document produces the warning Package multicol Warning: Floats and marginpars not allowed inside multicols' environment!. and that's the answer, multicol doesn't support figure. – David Carlisle Feb 17 '15 at 1:46
• Is there a way to fix that. I just need to plot this function 1/(1+(1/x)) with a caption under it in two column paper. Also the figure does appear when I remove the figure tag and leave the tikzpicture tag. – MrDi Feb 17 '15 at 1:50
• remove figure and use \captionof{figure}{zzzz} (capt-of package) under the tikzpicture – David Carlisle Feb 17 '15 at 1:54

If you're not too picky about where the figure is placed, there's a much simpler solution with a regular twocolumn article and the abstract package.

\documentclass[twocolumn]{article}
\usepackage{lipsum,mwe,abstract}

\title{Title}
\author{Author}

\begin{document}
\twocolumn[ % http://tex.stackexchange.com/a/28110
\maketitle
\begin{onecolabstract}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
\end{onecolabstract}
]
\saythanks

\section{One}
\lipsum[2-4]
\begin{figure*}[tbp]
\centering
\includegraphics[width=\columnwidth]{example-image-a}
\caption{A figure}
\end{figure*}
\end{document}
`