我使用LaTex中的rotate包将图表旋转270°,制作了一个横向的直方图。
调整所有标签和刻度没有问题,但我找不到一种方法来旋转图例。
这是我的gnuplot代码:
set terminal epslatex size 16cm, 32cm
set output "stackexchange.tex"
set xrange [-1:8]
set key
set boxwidth 0.95
set style data histograms
set style histogram errorbars
set style fill solid 0.8
set style line 1 lt 1 lc rgb "#0080B0" lw 3
set yrange[600:1100]
unset ytics
set y2tics rotate
set y2label rotate "xyz / abc"
set xtics nomirror rotate scale 0
plot 'stackexchange.dat' using 2:3:xticlabels(1) ls 1 title 'A', '' using 4:5 ls 1 fill pattern 6 title 'B'
这是我在LaTex中实现它的方式:
\begin{figure}
\begin{turn}{270}
\resizebox{!}{0.9\textwidth}{\input{stackexchange}}
\end{turn}
\end{figure}
这是我的数据文件:
A 890.1 3.2 789.9 11.7
B 626.97 20.467 862.8 12.3
C 923.9 5.89 963.8 3.7
D 785.233 15.921 627 2.3
E 903.167 7.94 880.9 1.9
F 863.43 25.237 778.2 4.2
G 909.6 5.370 941 13
H 895.633 40.401 813 11.3