0

I used "Forth Version" of from Question Polar histograms for building my diagram.

Exported PDF Document is fitting on a4 paper. How can I scale this to bigger paper formats? a3, a2, a1 a0 paper? Graphic and text should be scaled of course. Thanks!

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usepackage{ifthen}
\tikzset{
  orig/.style={
    hist 1/.style={fill=red!70!gray},
    hist 2/.style={fill=blue!60!white},
    hist 3/.style={fill=green!50!gray},
    arrow group/.style={draw,color=black,very thick,latex-latex},
    target/.style={fill=pink!60!black,draw=black,
      line width=1pt,double distance=1pt,double=white},
    rev text on arc/.style={
      decorate,decoration={text along path,
        text={##1},text align={align=center},
        text color=black,reverse path}
    },
    text on arc/.style={
      decorate,decoration={text along path,
        text={##1},text align={align=center},
        text color=black,
      },
    },
    major tick/.style={draw=white,thick},
    minor tick/.style={draw=white,thin,draw opacity=.5},
    tick label/.style={font=\tiny\bfseries},
    text=black,
    font=\bfseries\sffamily,
  },
  dartstyle/.style={
    hist 1/.style={fill=red!80!white},
    hist 2/.style={fill=yellow!60!white},
    hist 3/.style={fill=green!70!black},
    arrow group/.style={draw=white,white,very thick,latex-latex},
    target/.style={fill=black,draw=black,
      line width=1pt,double distance=1pt,double=white},
    rev text on arc/.style={
      decorate,decoration={text along path,
        text={##1},text align={align=center},
        text color=white,reverse path}
    },
    text on arc/.style={
      decorate,decoration={text along path,
        text={##1},text align={align=center},
        text color=white}
    },
    major tick/.style={draw=white,thick},
    minor tick/.style={draw=white,thin,draw opacity=.5},
    tick label/.style={font=\tiny\bfseries},
    text=white,
    font=\bfseries\sffamily,
  },
}

\def\astep{9} % step (degree) between sectors
\def\mstep{3} % half width (degree) of each sector
\def\min{8mm} % min distance from center
\def\max{4cm} % max distance from center

\def\mydata{%
  First Group/{%
    xxx/{10,30,60},%
    aab/{20,30,50},%
    aba/{30,30,40},%
    aad/{40,30,30},%
    aca/{50,30,20},%
    zcb/{60,10,30},%
    aaa/{10,30,60},%
    aab/{30,30,40},%
    aba/{10,80,10},%
    aad/{30,30,40},%
    aca/{10,30,60}%
  },%
  Second Group/{%
    yyy/{60,10,30},%
    zcb/{60,10,30},%
    aaa/{10,30,60},%
    aab/{30,30,40},%
    aba/{10,80,10},%
    aad/{30,30,40},%
    aca/{10,30,60},%
    zcb/{60,10,30},%
    zcb/{75,10,15},%
    aaa/{10,30,60}%
  },%
  Third Group/{%
    zzz/{30,30,40},%
    aba/{10,80,10},%
    aad/{30,30,40},%
    aca/{10,30,60},%
    zcb/{60,10,30},%
    zcb/{60,10,30},%
    aaa/{10,30,60},%
    aab/{30,30,40},%
    aba/{10,80,10},%
    aad/{30,30,40},%
    aca/{10,30,60},%
    zcb/{60,30,10}% 
  }%
}

\begin{document}
\begin{tikzpicture}[orig]
  \tikzset{
    declare function={
      secttoangle(\sect)=(\sect)*\astep;
      percenttodist(\percent)=\min+(\max-\min)/100*\percent;
    },
  }

  \path[target]
  circle(\max+1.6cm);

  \def\cursectinit{-.666}
  \foreach \curgroup/\curdata in \mydata {
    \foreach \curlabel/\values [count=\cp] in \curdata {
      % angle for this current label
      \pgfmathsetmacro{\angle}{secttoangle(\cursectinit+\cp)}
      % percent
      \xdef\total{0}
      % histogram
      \foreach \val [count=\cv] in \values {
        \pgfmathsetmacro{\nexttotal}{\total+\val}
        \pgfmathsetmacro{\dmin}{percenttodist(\total)}
        \pgfmathsetmacro{\dmax}{percenttodist(\nexttotal)}
        % sector
        \path[hist \cv=\angle] (\angle+\mstep:\dmin pt)
        arc(\angle+\mstep:\angle-\mstep:\dmin pt) -- (\angle-\mstep:\dmax pt)
        arc(\angle-\mstep:\angle+\mstep:\dmax pt) -- cycle;
        % iteration
        \xdef\total{\nexttotal}
      }
      % label (with autorotation)
      \pgfmathtruncatemacro{\revlab}{and(\angle>90,\angle<270)?1:0}
      \ifthenelse{\equal{\revlab}{1}}{ 
        \node[rotate=180+\angle,anchor=east] at (\angle:\max) {\curlabel};
      }{
        \node[rotate=\angle,anchor=west] at (\angle:\max) {\curlabel};
      }
    }
    % group limits
    \pgfmathsetmacro{\newsectinit}{\cursectinit+\cp}
    \pgfmathsetmacro{\angleinit}{secttoangle(\cursectinit + 1)-\mstep}
    \pgfmathsetmacro{\anglefinal}{secttoangle(\newsectinit)+\mstep}
    % group label
    {
      \Large\bfseries\sffamily
      \pgfmathtruncatemacro{\anglem}{(\angleinit+\anglefinal)/2}
      \pgfmathtruncatemacro{\revtext}{and(\anglem>0,\anglem<180)?1:0}
      \ifthenelse{\equal{\revtext}{1}}{ 
        \draw[rev text on arc=\curgroup] (\angleinit:\max+1.1cm)
        arc(\angleinit:\anglefinal:\max+1.1cm);
      }{
        \draw[text on arc=\curgroup] (\angleinit:\max+1.1cm+.5em)
        arc(\angleinit:\anglefinal:\max+1.1cm+.5em);
      }
    }
    % group arrow
    \path[arrow group]
    (\angleinit:\max+9mm) arc(\angleinit:\anglefinal:\max+9mm);
    % iteration
    \pgfmathsetmacro{\newsectinit}{\newsectinit+1}
    \xdef\cursectinit{\newsectinit}
  }

  % level ticks
  \pgfmathsetmacro{\angleinit}{secttoangle(0)}
  \pgfmathsetmacro{\anglefinal}{secttoangle(\cursectinit-1)+\mstep}
  % major ticks with labels
  \foreach \percent in {0,50,100}{
    \pgfmathsetmacro{\dist}{percenttodist(\percent)}
    % tick
    \path[major tick] (\angleinit:\dist pt)
    arc(\angleinit:\anglefinal:\dist pt);
    % label
    \node[tick label,below,rotate=secttoangle(0)]
    at ({secttoangle(0)}:\dist pt) {\percent\%};
  }
  % minor ticks
  \foreach \percent in {10,20,30,40,60,70,80,90}{
    \pgfmathsetmacro{\dist}{percenttodist(\percent)}
    % tick
    \path[minor tick] (\angleinit:\dist pt)
    arc(\angleinit:\anglefinal:\dist pt);
  }

  % legend
  \foreach \mycat [count=\c] in {Bad,Mediocre,Good}{
    \path[hist \c=0] (2.75,-.5-.5*\c) rectangle ++(.2,.2) ++(0,-.1)
    node[right]{\mycat};
  }
\end{tikzpicture}
\end{document}
  • Well, your code uses standalone, so your figure doesn't fit any paper size - its size is flexible. – user156344 Feb 27 at 15:41
0

You can use \includegraphics from the graphicx package to load the finished diagram into another document. Then, use the width= or height= keys, to adjust the size.

Assuming, you created the file diagram.pdf using your code above, do

\documentclass{standalone}

\usepackage{graphicx}
\usepackage{parskip}

\begin{document}

    \includegraphics[width=\textwidth]{diagram.pdf}

\end{document}
  • Hi @DLichti, thank you very much for your answer! It is possible to scale up with your solution. But it cuts the circle on first page +. Left upper part will be on the new pdf losing right side and south part of the circle. There ar no further pages for the missing parts. I played with \includegraphics[width=60cm,height=60cm]{diagram.pdf} – flobian Mar 8 at 6:29
  • I changed documentclass to standalone, seems to work. Trying to do printing out now. – flobian Mar 8 at 6:33
  • It works out by changing documentclass to standalone! Thank you very much! Now I can print out Diagram on multiple A3 sheets (PDF -> PosteRazor -> PDF multiple pages ->print out -> stick paper together and be HAPPY!) – flobian Mar 8 at 6:44

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.