因为预计值在另一个轴上,即:由于预期价格为 100 而数量为 35,所以应该交换刻度(x 和 y 代表本来的意思,但值被交换了)。
我不知道这里缺少什么,这应该是概念性的,但由于我找不到它,
如何交换轴的值,以便公共点代表价格 100,000 和数量 35?(而不是 35000 和 100)
有没有办法获取该点交点的坐标?
\usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture}[scale=0.5] \begin{axis}[legend style={at={(0.5,-0.1)},anchor=north}, axis lines = middle, xmax=200, ymin=0, xlabel = $Quantity$, ylabel = {$Price$}, title=Orange market, % label style={anchor=north east}, x tick label style = {font = \small, text width = 1cm, align = center, rotate = 0, anchor = north east}, extra x ticks = {0}, ytick={0,10 000,...,60 000}, scaled y ticks=false, ticklabel style = {font=\footnotesize}, yticklabel style={/pgf/number format/fixed}, enlargelimits={0.15,upper}, % domain=0:200, no marks, every axis plot post/.append style={thick, dashed}, ] \addplot +[name path=A] {10000+250*x} node[right]{$O$}; \addplot +[name path=B] {50000-150*x} node[right]{$D$}; \fill [fill=brown,name intersections={of=A and B, by=a},total=\t,] (a) circle[radius=1.5pt]; \addlegendentry{$Offer$} \addlegendentry{$Demand$} \end{axis} %\draw[->] (0,0) -- (5,0) node[below] {Qty}; %\draw[->] (0,0) -- (0,5) node[left] {$}; %\coordinate (p1) at (0.55,0.55); %\draw [-{Stealth}] (1,1)--(2,2); %\draw [-{Stealth}] (2,2)--(1,1); \end{tikzpicture} \end{document}```