我要将一个图放入报告中,该图需要增加水平宽度,同时保持原始垂直高度。我目前正在使用 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
。