Graphics, Figures & TablesRotate the picture I've drawn

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Mimi
Posts: 5
Joined: Wed Jan 07, 2015 5:40 pm

Rotate the picture I've drawn

Post by Mimi »

Hello everyone!

Here, I've attached the picture of the graph I need to draw. As you can see, the picture has 3 similar parts. The code for one of the 3 parts is as below:

Code: Select all

\documentclass{article}

\begin{document}

\begin{figure}
\setlength{\unitlength}{0.2in}
\centering
\begin{picture}(14,11)
\thicklines

\put(4,7){\begin{picture}(6,5)

	\put(0,5){\line(1,0){6}}
	\put(3,0){\line(-3,5){3}}
	\put(3,0){\line(3,5){3}}

	\put(0.6,4){\line(1,0){4.8}}
	\put(1.8,4){\line(3,-5){1.8}}
	\put(2.4,3){\line(1,0){2.4}}

	\put(3,5){\line(0,-1){1}}
	\put(4.2,4){\line(-3,-5){0.6}}
	\put(3,2){\line(-3,-5){0.6}}
			
	\put(0,5){\circle*{0.4}}
	\put(3,5){\circle*{0.4}}
	\put(6,5){\circle*{0.4}}
	\put(0.6,4){\circle*{0.4}}
	\put(1.8,4){\circle*{0.4}}
	\put(3,4){\circle*{0.4}}
	\put(4.2,4){\circle*{0.4}}
	\put(5.4,4){\circle*{0.4}}
	\put(2.4,3){\circle*{0.4}}
	\put(3.6,3){\circle*{0.4}}
	\put(4.8,3){\circle*{0.4}}
	\put(3,2){\circle*{0.4}}
	\put(2.4,1){\circle*{0.4}}
	\put(3.6,1){\circle*{0.4}}
	\put(3,0){\circle*{0.4}}
	
	\end{picture}}

\end{picture}
\caption{Tutte's graph.} 
\end{figure}

\end{document}
So, I would like to know if there is a way that I can duplicate and rotate and get all 3 parts (without having to draw each part individually)?
Attachments
Tuttes_graph (200x195).jpg
Tuttes_graph (200x195).jpg (43.16 KiB) Viewed 6347 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Rotate the picture I've drawn

Post by Stefan Kottwitz »

Hi Mimi,

welcome to the forum!

Very good, that you posted a compilable example with image. So I could modify it. You can use \rotatebox of the graphicx-Package.

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\begin{figure}
\setlength{\unitlength}{0.2in}
\centering
\begin{picture}(14,11)
\thicklines

\put(4,7){\begin{picture}(6,5)

        \put(0,5){\line(1,0){6}}
        \put(3,0){\line(-3,5){3}}
        \put(3,0){\line(3,5){3}}

        \put(0.6,4){\line(1,0){4.8}}
        \put(1.8,4){\line(3,-5){1.8}}
        \put(2.4,3){\line(1,0){2.4}}

        \put(3,5){\line(0,-1){1}}
        \put(4.2,4){\line(-3,-5){0.6}}
        \put(3,2){\line(-3,-5){0.6}}
                        
        \put(0,5){\circle*{0.4}}
        \put(3,5){\circle*{0.4}}
        \put(6,5){\circle*{0.4}}
        \put(0.6,4){\circle*{0.4}}
        \put(1.8,4){\circle*{0.4}}
        \put(3,4){\circle*{0.4}}
        \put(4.2,4){\circle*{0.4}}
        \put(5.4,4){\circle*{0.4}}
        \put(2.4,3){\circle*{0.4}}
        \put(3.6,3){\circle*{0.4}}
        \put(4.8,3){\circle*{0.4}}
        \put(3,2){\circle*{0.4}}
        \put(2.4,1){\circle*{0.4}}
        \put(3.6,1){\circle*{0.4}}
        \put(3,0){\circle*{0.4}}
        
        \end{picture}}
\put(7.05,4.3){\rotatebox{120}{\begin{picture}(6,5)

        \put(0,5){\line(1,0){6}}
        \put(3,0){\line(-3,5){3}}
        \put(3,0){\line(3,5){3}}

        \put(0.6,4){\line(1,0){4.8}}
        \put(1.8,4){\line(3,-5){1.8}}
        \put(2.4,3){\line(1,0){2.4}}

        \put(3,5){\line(0,-1){1}}
        \put(4.2,4){\line(-3,-5){0.6}}
        \put(3,2){\line(-3,-5){0.6}}
                        
        \put(0,5){\circle*{0.4}}
        \put(3,5){\circle*{0.4}}
        \put(6,5){\circle*{0.4}}
        \put(0.6,4){\circle*{0.4}}
        \put(1.8,4){\circle*{0.4}}
        \put(3,4){\circle*{0.4}}
        \put(4.2,4){\circle*{0.4}}
        \put(5.4,4){\circle*{0.4}}
        \put(2.4,3){\circle*{0.4}}
        \put(3.6,3){\circle*{0.4}}
        \put(4.8,3){\circle*{0.4}}
        \put(3,2){\circle*{0.4}}
        \put(2.4,1){\circle*{0.4}}
        \put(3.6,1){\circle*{0.4}}
        \put(3,0){\circle*{0.4}}
        
        \end{picture}}}
\end{picture}
\caption{Tutte's graph.} 
\end{figure}

\end{document}
I would use TikZ for such a drawing.

Stefan
LaTeX.org admin
Mimi
Posts: 5
Joined: Wed Jan 07, 2015 5:40 pm

Rotate the picture I've drawn

Post by Mimi »

Hi Stefan!

I got the error ! Paragraph ended before \Grot@box@std was complete. with graphicx package. I did some research on the internet and found this post. So, I added the rotating package to the code you gave and it works.

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{rotating}

\begin{document}

\begin{figure}
\setlength{\unitlength}{0.2in}
\centering
\begin{picture}(14,11)
\thicklines

\put(4,7){\begin{picture}(6,5)

        \put(0,5){\line(1,0){6}}
        \put(3,0){\line(-3,5){3}}
        \put(3,0){\line(3,5){3}}

        \put(0.6,4){\line(1,0){4.8}}
        \put(1.8,4){\line(3,-5){1.8}}
        \put(2.4,3){\line(1,0){2.4}}

        \put(3,5){\line(0,-1){1}}
        \put(4.2,4){\line(-3,-5){0.6}}
        \put(3,2){\line(-3,-5){0.6}}
                        
        \put(0,5){\circle*{0.4}}
        \put(3,5){\circle*{0.4}}
        \put(6,5){\circle*{0.4}}
        \put(0.6,4){\circle*{0.4}}
        \put(1.8,4){\circle*{0.4}}
        \put(3,4){\circle*{0.4}}
        \put(4.2,4){\circle*{0.4}}
        \put(5.4,4){\circle*{0.4}}
        \put(2.4,3){\circle*{0.4}}
        \put(3.6,3){\circle*{0.4}}
        \put(4.8,3){\circle*{0.4}}
        \put(3,2){\circle*{0.4}}
        \put(2.4,1){\circle*{0.4}}
        \put(3.6,1){\circle*{0.4}}
        \put(3,0){\circle*{0.4}}
        
        \end{picture}}

\put(7.05,4.3){\begin{rotate}{120}{\begin{picture}(6,5)

        \put(0,5){\line(1,0){6}}
        \put(3,0){\line(-3,5){3}}
        \put(3,0){\line(3,5){3}}

	\put(0.6,4){\line(1,0){4.8}}
        \put(1.8,4){\line(3,-5){1.8}}
        \put(2.4,3){\line(1,0){2.4}}

        \put(3,5){\line(0,-1){1}}
        \put(4.2,4){\line(-3,-5){0.6}}
        \put(3,2){\line(-3,-5){0.6}}
                        
        \put(0,5){\circle*{0.4}}
        \put(3,5){\circle*{0.4}}
        \put(6,5){\circle*{0.4}}
        \put(0.6,4){\circle*{0.4}}
        \put(1.8,4){\circle*{0.4}}
        \put(3,4){\circle*{0.4}}
        \put(4.2,4){\circle*{0.4}}
        \put(5.4,4){\circle*{0.4}}
        \put(2.4,3){\circle*{0.4}}
        \put(3.6,3){\circle*{0.4}}
        \put(4.8,3){\circle*{0.4}}
        \put(3,2){\circle*{0.4}}
        \put(2.4,1){\circle*{0.4}}
        \put(3.6,1){\circle*{0.4}}
        \put(3,0){\circle*{0.4}}

	\end{picture}}

	\end{rotate}}

\end{picture}
\caption{Tutte's graph.} 
\end{figure}

\end{document}
It also works without the graphicx-Package. About the error, could you clarify it for me.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Rotate the picture I've drawn

Post by Stefan Kottwitz »

Hi Mimi,

my code works for me without error. Perhaps you did a modification? For example, don't use empty lines in such environments, which stand for paragraph breaks in LaTeX. Looks like matching the error "Paragraph ended before ... complete".

Wenn, if it works with rotating, fine. But you could consider updating the graphicx package or the whole TeX installation, if it happens with exactly my code, and is so caused by an older version.

Stefan
LaTeX.org admin
Mimi
Posts: 5
Joined: Wed Jan 07, 2015 5:40 pm

Rotate the picture I've drawn

Post by Mimi »

Hi Stefan,
For example, don't use empty lines in such environments, which stand for paragraph breaks in LaTeX.
I have removed all empty lines and it works. 谢谢你.

Mimi
Post Reply