tikz diagram does not scale

View: New views
5 Messages — Rating Filter:   Alert me  

Parent Message unknown tikz diagram does not scale

by Erik Bernoth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

I try to create some diagrams with pgf/tikz but can't scale them now. If I try the examples with Karl in the tikz documentation, they work. Can you explain the difference here and there?

(I set up a minimum example, but hopefully all key elements are involved)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt,oneside,a4paper]{book}
\pagestyle{headings}
\usepackage[german]{babel}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning,shapes.misc,chains,arrows,fit}

\begin{document}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\tikzset{
  line/.style ={draw, thick,shorten >=0.1pt},
  background colors/.style={fill=black!3, draw=black!80}
}%e.o.tikzset
\begin{figure}
\begin{tikzpicture} [scale=0.25] %scaling here?
  \node (a) {peter};
  \node [right=of a] (b) {parker};
  \begin{scope}
    \path[line] (a) -- (b);
  \end{scope}
  \begin{pgfonlayer}{background}
    \node (c) [fill=black!10, fit=(a) (b)] {};
  \end{pgfonlayer}
\end{tikzpicture}
\caption{some text \label{scaleMe}}
\end{figure}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

regards
Erik B.


------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Parent Message unknown Re: tikz diagram does not scale

by Erik Bernoth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just for other guys with the same question: If you set your every node style with a scale value, the whole thing scales.

this works:
\tikzset{
  every node/.style={scale=0.5}
}
%[...]
\begin{tikzpicture}
  \node(A) {something};
  \node(B) [right=of A] {else};
\end{tikzpicture}

this does not work:
\begin{tikzpicture}[scale=0.5]
  \node(A) {something};
  \node(B) [right=of A] {else};
\end{tikzpicture}

and this does not work, too:
\begin{tikzpicture}[xscale=3,yscale=3]
\node (a) {bla};
\node [right=of a] {bla2};
\end{tikzpicture}

I just found out by accident. And I can't find a proper source in the documentation. I just can say, that in own experiments with scale as tikzpicture-attribute (like you can see it used on page 301 pgfmanual) it just made the borders broader. The content stayed in the same size.

regards
Erik Bernoth

------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: tikz diagram does not scale

by Christoph Bartoschek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I did not check your example. But do you search the option "transform shape"?

\begin{tikzpicture}[scale=0.5, transform shape]
  \node(A) {something};
  \node(B) [right=of A] {else};
\end{tikzpicture}

Christoph

------------------------------------------------------------------------------
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: tikz diagram does not scale

by James Ismail :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Erik.  That seems to be exactly what I was looking for.

-James

On Mon, Jun 29, 2009 at 10:41 AM, Erik Bernoth <erik.bernoth@...> wrote:
Just for other guys with the same question: If you set your every node style with a scale value, the whole thing scales.

this works:
\tikzset{
  every node/.style={scale=0.5}
}
%[...]
\begin{tikzpicture}
  \node(A) {something};
  \node(B) [right=of A] {else};
\end{tikzpicture}

this does not work:
\begin{tikzpicture}[scale=0.5]
  \node(A) {something};
  \node(B) [right=of A] {else};
\end{tikzpicture}

and this does not work, too:
\begin{tikzpicture}[xscale=3,yscale=3]
\node (a) {bla};
\node [right=of a] {bla2};
\end{tikzpicture}

I just found out by accident. And I can't find a proper source in the documentation. I just can say, that in own experiments with scale as tikzpicture-attribute (like you can see it used on page 301 pgfmanual) it just made the borders broader. The content stayed in the same size.

regards
Erik Bernoth

------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users



------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: tikz diagram does not scale

by Erik Bernoth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christoph,

thanks for trying to support us.
I checked it right now. Transform shape works, if I use that simple example from the pgfmanual.pdf page 161 works. But if I try to implement it in my diagrams it will do nothing at all.

example works (page 161):
\tikz[scale=3] \node[transform shape] {X};

here nothing happens (my flowchart):
\begin{tikzpicture}[scale=0.1,transform shape]
%....
\end{tikzpicture}

here, too, nothing happens (my flowchart):
\begin{tikzpicture}[scale=0.1,every node/.style={transform shape}]
%....
\end{tikzpicture}
Christoph Bartoschek wrote:
Hi,

I did not check your example. But do you search the option "transform shape"?

\begin{tikzpicture}[scale=0.5, transform shape]
  \node(A) {something};
  \node(B) [right=of A] {else};
\end{tikzpicture}

Christoph

------------------------------------------------------------------------------
_______________________________________________
pgf-users mailing list
pgf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users