Saltar al contenido

¿Cómo puedo rotar una imagen tikz?

Siéntete en la libertad de divulgar nuestro sitio y códigos con otro, apóyanos para ampliar esta comunidad.

Solución:

Puedes usar el rotar key, pero también necesitas transform shape o los nodos no se rotan:

documentclassarticle
usepackagetikz
usetikzlibraryshapes,arrows
usepackage[active,tightpage]preview
PreviewEnvironmenttikzpicture

begindocument

%pagestyleempty
tikzstyledecision = [diamond, draw, fill=blue!20,
    text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
tikzstyleblock = [rectangle, draw, fill=gray!20, text width=7.5em, rounded corners, minimum height=4.1em]
tikzstyleblocks = [rectangle, fill=white!20, text width=9em, rounded corners, minimum height=4em]
tikzstyleline = [draw, -latex']
tikzstylecloud = [ellipse,fill=white!20, node distance=2cm,
    minimum height=2em]


begintikzpicture[node distance = 2cm, auto,rotate=90,transform shape]

    %node [block] (initial) Initial text;
    node [block] (beginning) tiny Beginning;
    node [cloud, below of =beginning] (decide) Reactions;
    node [block, below of=decide, node distance=3cm](stop)tiny textbfSecond alternative: Wait ;
    node[block, left of =stop, node distance=3cm](left)tiny textbfFirst alternative: Continue;
    node[block, right of =stop, node distance=3cm](right)tiny textbfThird alternative: Give in ;
    node[blocks, below of =left, node distance=2cm](node name)large Logo;
    %path [line] (initial) -- (evaluate);
    path [line] (beginning) -- (decide);
    path [line] (decide) -- node (stop);
    path [line](decide)--(right);
    path [line](decide)--(left);
endtikzpicture

enddocument

ingrese la descripción de la imagen aquí

Solución divertida: envolver un tikzpicture en un tikzpicture nodo que se gira 90 grados:

documentclassarticle
usepackagetikz
usetikzlibraryshapes,arrows
usepackage[active,tightpage]preview
PreviewEnvironmenttikzpicture

begindocument

%pagestyleempty
tikzset
  ,decision/.style=
    
      diamond, draw, fill=blue!20, text width=4.5em, text badly centered, 
      node distance=3cm, inner sep=0pt
    
  ,block/.style=
    
      rectangle, draw, fill=gray!20, text width=7.5em, rounded corners, 
      minimum height=4.1em
    
  ,blocks/.style=
    
      rectangle, fill=white!20, text width=9em, rounded corners,
      minimum height=4em
    
  ,line/.style=draw, -latex'
  ,cloud/.style=ellipse,fill=white!20, node distance=2cm, minimum height=2em


begintikzpicture
  node[rotate=90] at (0,0) 
    begintikzpicture[node distance = 2cm, auto]

        %node [block] (initial) Initial text;
        node [block] (beginning) tiny Beginning;
        node [cloud, below of =beginning] (decide) Reactions;
        node [block, below of=decide, node distance=3cm](stop)tiny textbfSecond alternative: Wait ;
        node[block, left of =stop, node distance=3cm](left)tiny textbfFirst alternative: Continue;
        node[block, right of =stop, node distance=3cm](right)tiny textbfThird alternative: Give in ;
        node[blocks, below of =left, node distance=2cm](node name)large Logo;  
        %path [line] (initial) -- (evaluate);
        path [line] (beginning) -- (decide);
        path [line] (decide) -- node (stop);
        path [line](decide)--(right);
        path [line](decide)--(left);
    endtikzpicture
  ;
endtikzpicture

enddocument

Con standalone clase de documento como elemento de recorte en lugar de preview paquete, puede incluir el tikzpicture dentro de una rotatebox comando para obtener el resultado deseado.

documentclassstandalone
usepackagetikz
usetikzlibraryshapes,arrows
%usepackage[active,tightpage]preview
%PreviewEnvironmenttikzpicture

begindocument

%pagestyleempty
tikzstyledecision = [diamond, draw, fill=blue!20, 
    text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
tikzstyleblock = [rectangle, draw, fill=gray!20, text width=7.5em, rounded corners, minimum height=4.1em]
tikzstyleblocks = [rectangle, fill=white!20, text width=9em, rounded corners, minimum height=4em]
tikzstyleline = [draw, -latex']
tikzstylecloud = [ellipse,fill=white!20, node distance=2cm,
    minimum height=2em]


rotatebox90%
begintikzpicture[node distance = 2cm, auto]

    %node [block] (initial) Initial text;
    node [block] (beginning) tiny Beginning;
    node [cloud, below of =beginning] (decide) Reactions;
    node [block, below of=decide, node distance=3cm](stop)tiny textbfSecond alternative: Wait ;
    node[block, left of =stop, node distance=3cm](left)tiny textbfFirst alternative: Continue;
    node[block, right of =stop, node distance=3cm](right)tiny textbfThird alternative: Give in ;
    node[blocks, below of =left, node distance=2cm](node name)large Logo;  
    %path [line] (initial) -- (evaluate);
    path [line] (beginning) -- (decide);
    path [line] (decide) -- node (stop);
    path [line](decide)--(right);
    path [line](decide)--(left);
endtikzpicture


enddocument

ingrese la descripción de la imagen aquí

Te mostramos reseñas y valoraciones

Finalizando este artículo puedes encontrar los comentarios de otros usuarios, tú todavía tienes la habilidad dejar el tuyo si dominas el tema.

¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *