# How can I rotate and mirror a tikz picture in latex

I'm wondering if someone knows how to place one tikz picture cone face to the other in the horizontal position.

\documentclass[varwidth,margin=0.5cm]{standalone}
\usepackage{tikz}
\usepackage{amssymb}

\begin{document}
\begin{tikzpicture}
\fill[top color=gray!50!black,bottom color=gray!10,middle color=gray,shading=axis,opacity=0.25] (0,0) circle (3cm and 0.5cm);
\fill[left color=gray!50!black,right color=gray!50!black,middle  color=gray!50,shading=axis,opacity=0.25] (3,0) -- (0,6) -- (-3,0) arc (180:360:3cm and 0.5cm);
\draw (-3,0) arc (180:360:3cm and 0.5cm) -- (0,6) -- cycle;
\draw[densely dashed] (-3,0) arc (180:0:3cm and 0.5cm);
\end{tikzpicture}
\end{document}


-

## migrated from stackoverflow.comDec 23 '13 at 20:41

This question came from our site for professional and enthusiast programmers.

Your example doesn't compile for me, but does tex.stackexchange.com/questions/119914/… help?¨ – Torbjørn T. Dec 23 '13 at 22:07

With solution provided by Harish Kumar in Can we mirror a part in tikz? as Torbjørn suggested, it is easy to get this

If this is what you want, the code is:

\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}
\fill[top color=gray!50!black,bottom color=gray!10,middle color=gray,shading=axis,opacity=0.25]           (0,0) circle (3cm and 0.5cm);
\fill[left color=gray!50!black,right color=gray!50!black,middle  color=gray!50,shading=axis,opacity=0.25] (3,0) -- (0,6) -- (-3,0) arc (180:360:3cm and 0.5cm);
\draw (-3,0) arc (180:360:3cm and 0.5cm) -- (0,6) -- cycle;
\draw[densely dashed] (-3,0) arc (180:0:3cm and 0.5cm);

\begin{scope}[xscale=1,yscale=-1]
\fill[top color=gray!50!black,bottom color=gray!10,middle color=gray,shading=axis,opacity=0.25]           (0,0) circle (3cm and 0.5cm);
\fill[left color=gray!50!black,right color=gray!50!black,middle  color=gray!50,shading=axis,opacity=0.25] (3,0) -- (0,6) -- (-3,0) arc (180:360:3cm and 0.5cm);
\draw (-3,0) arc (180:360:3cm and 0.5cm) -- (0,6) -- cycle;
\draw[densely dashed] (-3,0) arc (180:0:3cm and 0.5cm);
\end{scope}
\end{tikzpicture}

\end{document}

-

TiKZ 3.0.0 (already available at CTAN) introduces a new concept call pic

A “pic” is a “short picture” (hence the short name...) that can be inserted anywhere in TikZ picture where you could also insert a node. Similarly to nodes, pics have a “shape” (called type to avoid confusion) that someone has defined. Each time a pic of a specified type is used, the type’s code is executed, resulting in some drawings to be added to the current picture. The syntax for adding nodes and adding pics to a picture are also very similar. The core difference is that pics are typically more complex than nodes and may consist of a whole bunch of nodes themselves together with complex paths joining them.

with 'pics' it's easy to shift, rotate, mirror, ... every piece of your drawings. Next you have two examples:

\documentclass[border=2mm]{standalone}
\usepackage{tikz}

\tikzset{
cone/.pic={
\fill[top color=gray!50!black, bottom color=gray!10,
(0,0) circle (3cm and 0.5cm);
\fill[left color=gray!50!black, right color=gray!50!black,
(3,0) -- (0,6) -- (-3,0) arc (180:360:3cm and 0.5cm);
\draw (-3,0) arc (180:360:3cm and 0.5cm) -- (0,6) -- cycle;
\draw[densely dashed] (-3,0) arc (180:0:3cm and 0.5cm);
},
cone_inverted/.pic={
\fill[top color=gray!50!black, bottom color=gray!10,
(0,-6) circle (3cm and 0.5cm);
\fill[left color=gray!50!black, right color=gray!50!black,
(3,-6) -- (0,0) -- (-3,-6) arc (180:360:3cm and 0.5cm);
\draw (-3,-6) arc (180:360:3cm and 0.5cm) -- (0,0) -- cycle;
\draw[densely dashed] (-3,-6) arc (180:0:3cm and 0.5cm);
}
}
\begin{document}
\begin{tikzpicture}
\path (0,0) pic {cone} pic [rotate=180] {cone};
\end{tikzpicture}
\begin{tikzpicture}
\foreach \i in {0,60,...,360}
\path (0,0) pic [rotate=\i] {cone_inverted};
\end{tikzpicture}
\end{document}


-