2017-08-21 4 views
1

図の幅は十分ですが(軸線のスタイル)、次の図の外側の列は切り取られています。ダイアグラムの幅を設定しても役に立ちません。何か案が?バーの幅を大きくすると、何を設定したり拡大したりする必要がありますか?Tikz軸チャートの外側の列が切り捨てられます

\begin{tikzpicture} 
    \begin{axis}[ 
    ybar, 
    bar width=0.6cm, 
    tick align=inside, 
    major grid style={draw=white}, 
    enlarge y limits={value=.1,upper}, 
    ymin=0, ymax=100, 
    axis x line*=bottom, 
    axis y line*=right, 
    hide y axis,axis line style={shorten >=-15pt, shorten <=-15pt}, 
    symbolic x coords={Total, Women, Men}, 
    xtick=data, 
    nodes near coords={\pgfmathprintnumber[precision=0]{\pgfplotspointmeta} } 
    ] 
    \addplot [draw=none, fill=blue!30] coordinates { 
     (Total,75.4064) 
     (Women, 72.7961) 
     (Men,94.4597) }; 
    \addplot [draw=none,fill=red!30] coordinates { 
     (Total,75.4064) 
     (Women, 89.7961) 
     (Men,94.4597) }; 
    \addplot [draw=none, fill=green!30] coordinates { 
     (Total,75.4064) 
     (Women, 89.7961) 
     (Men,94.4597) }; 
    \legend{} 
    \end{axis} 
\end{tikzpicture} 

enter image description here

答えて

2

あなたはwidthを増加させ、バー・グループ(enlarge x limits=0.25)との間のスペースを減らすことができる:

\begin{tikzpicture} 
    \begin{axis}[ 
    ybar, 
    bar width=0.6cm, 
    enlarge x limits=0.25, 
    width=\textwidth, 
    tick align=inside, 
    major grid style={draw=black}, 
    enlarge y limits={value=.1,upper}, 
    ymin=0, ymax=100, 
    axis x line*=bottom, 
    axis y line*=right, 
    hide y axis,axis line style={shorten >=-15pt, shorten <=-15pt}, 
    symbolic x coords={Total, Women, Men}, 
    xtick=data, 
    nodes near coords={\pgfmathprintnumber[precision=0]{\pgfplotspointmeta} } 
    ] 
    \addplot [draw=none, fill=blue!30] coordinates { 
     (Total,75.4064) 
     (Women, 72.7961) 
     (Men,94.4597) }; 
    \addplot [draw=none,fill=red!30] coordinates { 
     (Total,75.4064) 
     (Women, 89.7961) 
     (Men,94.4597) }; 
    \addplot [draw=none, fill=green!30] coordinates { 
     (Total,75.4064) 
     (Women, 89.7961) 
     (Men,94.4597) }; 
    \legend{} 
    \end{axis} 
\end{tikzpicture} 

enter image description here

関連する問題