我正在尝试禁用此图表上显示的刻度:我尝试使用x tick=empty
如您所见的方法,但它似乎没有改变任何东西,因为我实际上并没有在轴上绘图,只是为了方便构造而使用它。有什么想法吗?
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[scale=0.9]
\begin{axis}[xtick=\empty, ytick=\empty, minor tick num=0, scaled ticks=false, xticklabel=\empty,yticklabel=\empty,axis x line=bottom,axis y line=left,xlabel={Volume}, ylabel={Pressure}]
\end{axis}
\draw [very thick][-latex](160pt,20pt)..controls(100pt,25pt) and (60pt,45pt)..(42pt,58pt);
\draw [very thick][-latex] (40pt,60pt)--(40pt,126pt);
\draw [very thick][-latex] (40pt,130pt)..controls(60pt,90pt) and (100pt,70pt)..(157pt,60pt);
\draw [very thick][-latex] (160pt,60pt)--(160pt,23pt);
\filldraw(40pt,60pt)circle(2pt) (40pt,130pt)circle (2pt)(160pt,60pt)circle(2pt)(160pt,20pt)circle(2pt);
\draw (160pt,20pt) node [below right] {$1$};
\draw (40pt,60pt) node [below left] {$2$};
\draw (40pt,130pt) node [left] {$3$};
\draw (160pt,60pt) node [above right] {$4$};
\end{tikzpicture}
\end{document}
答案1
我觉得pgfplots
有点过头了,因为只需要画两条线。不过你可以使用ticks=none
选项稍微简化一下。
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[scale=0.9]
\begin{axis}[ticks=none,axis x line=bottom,axis y line=left,xlabel={Volume}, ylabel={Pressure}]
\end{axis}
\draw [very thick][-latex](160pt,20pt)..controls(100pt,25pt) and (60pt,45pt)..(42pt,58pt);
\draw [very thick][-latex] (40pt,60pt)--(40pt,126pt);
\draw [very thick][-latex] (40pt,130pt)..controls(60pt,90pt) and (100pt,70pt)..(157pt,60pt);
\draw [very thick][-latex] (160pt,60pt)--(160pt,23pt);
\filldraw(40pt,60pt)circle(2pt) (40pt,130pt)circle (2pt)(160pt,60pt)circle(2pt)(160pt,20pt)circle(2pt);
\draw (160pt,20pt) node [below right] {$1$};
\draw (40pt,60pt) node [below left] {$2$};
\draw (40pt,130pt) node [left] {$3$};
\draw (160pt,60pt) node [above right] {$4$};
\end{tikzpicture}
\end{document}