1

How are members of the page. I'm trying to make this homotopy diagram. I'm trying to rotate the rectangle that appears in the image 90 degrees. How could I do this in the code. Thank you. This is the code I have:

\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,shapes,decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\node at (0,0) {$H: I \times I \rightarrow G$};
\node[label=below:$z_1$]  (x1) at (6,0)  {$\bullet$};
\node[label=above:$z_0$]  (x0) at (9,4)  {$\bullet$};  
\node  at (9.5,2)  {$\subset G$}; 
\draw (x1.center) to [out=5,in=-90]++(2.8,1.8) to[out=90,in=-95](x0.center);
\draw (x1.center) to [out=10,in=-110]++(2.6,2) to[out=70,in=-103] 
(x0.center); 
\draw (x1.center) to [out=15,in=-105](x0.center);
\draw (x1.center) to [out=30,in=-150](x0.center);
\draw (x1.center) to [out=45,in=-170](x0.center); 
\draw (x1.center) to [out=50,in=-105]++(1.2,3)to [out=75,in=-172] 
(x0.center); 
\draw (x1.center) to [out=55,in=-100]++(1.0,3) to[out=80,in=-175] 
(x0.center); 
\draw (x1.center) to [out=60,in=-90]++(0.8,3) to[out=90,in=-180] 
(x0.center);
\begin{scope}[every node/.style={draw, anchor=text, rectangle split,
rectangle split parts=7,minimum width=2cm}]
\node (R) at (2,4){ \nodepart{two} \nodepart{three}
\nodepart{four}$I\times I$\nodepart{five}\nodepart{six}\nodepart{seven}};
\end{scope}
\draw[decorate,decoration={brace,mirror,raise=6pt,amplitude=10pt}, thick]
(R.north west)--(R.south west) ;
\draw[decorate,decoration={brace,raise=6pt,amplitude=10pt}, thick]
(R.north east)--(R.south east); 
\draw[->] ($(R.west)+(-20pt,0)$) to[out=-180,in=240] ++(0,2)
to [out=60,in=120]node[above,midway]{$H(0,t)$}(x0) ; 
\draw[->] ($(R.north)+(0,10pt)$) to [out=60,in=120]
node[above,midway]{$\gamma_0 \simeq \gamma_1$} ++(4.5,-1) ; 
\draw[->] ($(R.east)+(20pt,0)$)  to [out=0,in=140]
node[right,midway]{$H(1,t)$}(x1) ; 
\draw[->] ($(R.south)+(0,-20pt)$)  to [out=-85,in=-30]
node[below,midway]{$\alpha$}++(7,0) ;    
\end{tikzpicture}
\end{document}

enter image description here

9
  • Can you please make a minimal working example (MWE)? In the previous version of your code several tikz libraries were missing and now we have to guess even more. Oct 24, 2018 at 22:57
  • Apologies. I copied and pasted a different code. The one that appears now in the publication is the correct one. Oct 24, 2018 at 22:59
  • OK, then please add the necessary parts to make your new code into a compilable document. Oct 24, 2018 at 23:00
  • 2
    You can rotate the rectangle by adding ,rotate=-90,transform shape to the options scope in which you draw it. Or do ,rotate around={-90:(2,2)},transform shape if you want to rotate it about the point at (2,2).
    – user121799
    Oct 24, 2018 at 23:07
  • 2
    Yes, the issue with the coordinates happens because some coordinates are essentially hardcoded. The overlap can be avoided by rotating about some appropriate point.
    – user121799
    Oct 24, 2018 at 23:23

1 Answer 1

4

The splitted rectangle shape has a switch to make it horizontal: rectangle split horizontal=true

\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,shapes,decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\begin{scope}[every node/.style={draw, anchor=text, rectangle split,
rectangle split parts=7,minimum height=2cm,rectangle split horizontal}]
\node (R) at (2,4){};
\end{scope}  
\end{tikzpicture}
\end{document}

Full MWE (some of the hard coded coordinates have to be adjusted):

\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,shapes,decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\node at (0,0) {$H: I \times I \rightarrow G$};
\node[label=below:$z_1$]  (x1) at (6,0)  {$\bullet$};
\node[label=above:$z_0$]  (x0) at (9,4)  {$\bullet$};  
\node  at (9.5,2)  {$\subset G$}; 
\draw (x1.center) to [out=5,in=-90]++(2.8,1.8) to[out=90,in=-95](x0.center);
\draw (x1.center) to [out=10,in=-110]++(2.6,2) to[out=70,in=-103] 
(x0.center); 
\draw (x1.center) to [out=15,in=-105](x0.center);
\draw (x1.center) to [out=30,in=-150](x0.center);
\draw (x1.center) to [out=45,in=-170](x0.center); 
\draw (x1.center) to [out=50,in=-105]++(1.2,3)to [out=75,in=-172] 
(x0.center); 
\draw (x1.center) to [out=55,in=-100]++(1.0,3) to[out=80,in=-175] 
(x0.center); 
\draw (x1.center) to [out=60,in=-90]++(0.8,3) to[out=90,in=-180] 
(x0.center);
\begin{scope}[every node/.style={draw, anchor=text, rectangle split,
rectangle split parts=7,minimum height=2cm,rectangle split horizontal}]
\node (R) at (0,2){ \nodepart{two} \nodepart{three}
\nodepart{four}\rotatebox{90}{$I\times I$}\nodepart{five}\nodepart{six}\nodepart{seven}};
\end{scope}
\draw[decorate,decoration={brace,mirror,raise=6pt,amplitude=10pt}, thick]
(R.north west)--(R.south west) ;
\draw[decorate,decoration={brace,raise=6pt,amplitude=10pt}, thick]
(R.north east)--(R.south east); 
\draw[->] ($(R.west)+(-20pt,0)$) to[out=-180,in=240] ++(0,2)
to [out=60,in=120]node[above,midway]{$H(0,t)$}(x0) ; 
\draw[->] ($(R.north)+(0,10pt)$) to [out=60,in=120] node[above,midway]{$\gamma_0 \simeq \gamma_1$} ++(5.4,0.4) ; 
\draw[->] ($(R.east)+(20pt,0)$)  to [out=0,in=140]
node[right,midway]{$H(1,t)$}(x1) ; 
\draw[->] ($(R.south)+(0,-20pt)$)  to [out=-85,in=-30]
node[below,midway]{$\alpha$}++(7,0) ;    
\end{tikzpicture}
\end{document}

enter image description here

(The idea to rotate I \times I is borrowed from @marmot - thanks a lot for the idea!)

3
  • 1
    thanks @samcarter and thanks and marmot four your help. Oct 25, 2018 at 3:00
  • rectangle split horizontal is a true Boolean by default, it is useless to add =true
    – AndréC
    Oct 25, 2018 at 5:55
  • @AndréC Thanks a lot for your comment. I updated my answer. Oct 25, 2018 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.