1

I'm confused about the next figure
enter image description here

because it was expected the values be in the other axis, i.e.: the scales should be swapped since the price expected was 100 and the amount 35 (x and y represents what is meant to be, but the values are swapped).

I don't know what is missing here, this should be conceptual, but since I cant find it,

  • How can be swapped the values of the axis, so the common point represents a price of 100,000 and an amount of 35?(instead of 35000 and 100)

  • Is there a way to get the coordinates of the intersection of the point?

     \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}```  
    
    
1
  • 5
    You got exactly what the code states. The formula is 10000 + 250*x, so for x = 0 you get 10000. Please note that the shown 10,000 is 10000 and not 10. The comma is the (English) thousand separator ... Commented Aug 24, 2021 at 19:44

0

You must log in to answer this question.

Browse other questions tagged .