다양한 용지 크기로 확장하시겠습니까?

다양한 용지 크기로 확장하시겠습니까?

질문의 "Forth Version"을 사용했습니다.극 히스토그램내 다이어그램을 작성해 주셔서 감사합니다.

내보낸 PDF 문서가 a4 용지에 맞습니다. 이것을 더 큰 종이 형식으로 확장하려면 어떻게 해야 합니까? a3, a2, a1 a0 용지? 물론 그래픽과 텍스트의 크기도 조정되어야 합니다. 감사해요!

\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}

답변1

\includegraphics다음에서 사용할 수 있습니다.graphicx완성된 다이어그램을 다른 문서에 로드하는 패키지입니다. 그런 다음 width=또는 height=키를 사용하여 크기를 조정합니다.

diagram.pdf위의 코드를 사용하여 파일을 생성했다고 가정 합니다.

\documentclass{standalone}

\usepackage{graphicx}
\usepackage{parskip}

\begin{document}

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

\end{document}

관련 정보