
我有一個要寫入報告的圖,需要增加水平寬度,同時保持原始的垂直高度。我目前正在使用 an xscale=1.7
,但這會將水平軸標籤移動到繪圖區域的右側。我嘗試過使用width=0.7\textwidth
但這將情節的高度增加到了荒謬的程度。
\documentclass[a4paper,12pt,twoside]{report}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[h]% change in entropy
\center
\begin{tikzpicture}
\begin{axis}[xscale=1.7, xlabel=No. of Elements, ystep=1, xstep=2, xmin=0, xmax=16, ymin=0, ymax=3, ylabel= $\Delta S_{mix} (R)$]
\addplot+[color=black,smooth,mark=none]file{Data/Entropy_of_Mixing.txt};
\draw(axis cs: 2,0)--(axis cs: 2,1);
\draw(axis cs: 5,0)--(axis cs: 5,1.8);
\draw(axis cs: 13,0)--(axis cs: 13,2.8);
\node [text width= 1.5cm, text centered](a) at(axis cs: 1,0.75){Low Entropy};
\node [text width= 1.5cm, text centered](a) at(axis cs: 3.6,0.75){Medium Entropy};
\node [text width= 1.5cm, text centered](a) at(axis cs: 9,0.75){High Entropy};
\end{axis}
\end{tikzpicture}
\caption{Change in mixing entropy with number of principal elements}
\label{EntropyGraph}
\end{figure}
\end{document
答案1
用。xscale=1.7
x post scale=1.7