I would like to plot a square from its vertices. For example:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=1]
\begin{axis}[xmin=0,xmax=1,ymin=0,ymax=1,enlargelimits=false,xlabel=$a_1$,ylabel=$a_2$]
\addplot [blue!80!black,fill=blue,fill opacity=0.4]
coordinates
{(0, 0) (0, 0.436694) (0.436694, 0) (0.436694, 0.436694)}
|- (axis cs:0,0) -- cycle;
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
but this code plots:
I would like to plot the square without having to remove the point (0.436694, 0).
Regards


(0, 0) (0, 0.436694) (0.436694, 0.436694) (0.436694, 0) }– Peter Grill Jun 09 '18 at 09:59--cyclethen it is best to have the points in an order that resembles a cycle. – Peter Grill Jun 09 '18 at 22:06