# Tikz rectangle in perspective

I would like to draw a rectangle in perspective which looks like this

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,1) -- (0,3) -- (2,5) -- (2,3) -- cycle;
\end{tikzpicture}
\end{document}


Is there an alternative way by declaring a rectangle

\tikzstyle{my_rectangle} = [rectangle, minimum width=2cm, minimum height=1cm]


and rotate it around the upward pointing axis? And if yes how would I do the rotation?

• \tikzstyle is deprecated. – user156344 Apr 23 at 12:42
• While TikZ itself supports 3d coordinates, they are not in gerneral orthogonal or normal. For that you should use tikz-3dplot. – John Kormylo Apr 23 at 13:56

\documentclass[tikz,margin=1pt]{standalone}