ミニページのテキストを中央に配置し、pgf-pie テキストを調整するにはどうすればいいですか

ミニページのテキストを中央に配置し、pgf-pie テキストを調整するにはどうすればいいですか

私はミニページを使用して図を 2 つの位置に分割しています。左側には pgf-pie で作成した図があり、大きなテキストを外側に書き込むことができ、テキストの場合は中央に配置したいと考えています (画像を参照してください)。

サンプル画像

\documentclass[12pt,a4paper]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgf-pie}

\begin{document}

\section{example}

\hrule
\begin{figure}[!h]
    \begin{minipage}[b]{0.3\textwidth}
        \caption{Example}\label{fig:ex1}
        \begin{tikzpicture}[scale=0.7]
            \pie[/tikz/nodes={text=white, font=\footnotesize\bfseries},
            text=inside,
            explode={0.1,0.1,0.1,0.1},color={blue!70,cyan!70,red!70,orange!50}]{9.3/Cedro\\rojo, 19.45/Café, 30.4/Cacao, 40.43/Tornillo }
        \end{tikzpicture}
    \end{minipage}\hfill\vrule\hfill
    \begin{minipage}[b]{0.6\textwidth}
        vallis augue. Etiam facilisis. Nunc elementum fermen-
        tum wisi. Aenean placerat. Ut imperdiet, enim sed
        gravida sollicitudin, felis odio placerat quam, ac pul-
        vinar elit purus eget enim. Nunc vitae tortor. Proin
        tempus nibh sit amet nisl. Vivamus quis tortor vitae
        risus porta vehicula.
    \end{minipage}
\end{figure}
\hrule

\end{document}

フォーラムの他の回答を確認してください。サポートされていないようです。フォーラム

答え1

  • オプションを使用すると、[b]ミニページが下揃えになります。それが望ましくない場合は、このオプションを使用しないでください。

  • 通常のtikzノードを使用して、円グラフの外側にテキストを手動で追加することもできます。


\documentclass[12pt,a4paper]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgf-pie}

\begin{document}

\section{example}

\hrule
\begin{figure}[!h]
    \begin{minipage}{0.45\textwidth}
        \caption{Example}\label{fig:ex1}
        \centering
        \begin{tikzpicture}[scale=0.7]
            \pie[/tikz/nodes={text=white, font=\footnotesize\bfseries},
            text=inside,
            explode={0.1,0.1,0.1,0.1},color={blue!70,cyan!70,red!70,orange!50}]{9.3/, 19.45/Café, 30.4/Cacao, 40.43/Tornillo }
            \node[align=center,font=\footnotesize] at (4.2,0.8) {Cedro\\rojo};
        \end{tikzpicture}%
    \end{minipage}\hfill\vrule\hfill
    \begin{minipage}{0.5\textwidth}
        vallis augue. Etiam facilisis. Nunc elementum fermen-
        tum wisi. Aenean placerat. Ut imperdiet, enim sed
        gravida sollicitudin, felis odio placerat quam, ac pul-
        vinar elit purus eget enim. Nunc vitae tortor. Proin
        tempus nibh sit amet nisl. Vivamus quis tortor vitae
        risus porta vehicula.
    \end{minipage}%
\end{figure}
\hrule

\end{document}

ここに画像の説明を入力してください

関連情報