2

I would like to make the three following diagrams which are interconnected.enter image description here

I meet two difficulties: both how to make these curvy lines within each diagram and how to connect them with dashed lines.

\documentclass{article}

\title{pgfplots - motor}

\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}


\begin{tikzpicture}
\draw[thick, ->] (0,0)--(0,4) node[left]{$Q$};
\draw[thick, ->] (0,0)--(4,0) node[below]{$L$};
\end{tikzpicture}
\begin{tikzpicture}
\draw[thick, ->] (0,0)--(0,4) node[left]{$C$};
\draw[thick, ->] (0,0)--(4,0) node[below]{$Q$};
\end{tikzpicture}
\begin{tikzpicture}
\draw[thick, ->] (0,0)--(0,4) node[left]{$C$};
\draw[thick, ->] (0,0)--(4,0) node[below]{$Q$};
\draw[thick, -] (0,1)--(4,1) node [right]{$FC$};
\end{tikzpicture}
\end{document}

EDIT: TP, AP, MP curves enter image description here

  • 2
    Can you show us what you have so far so we have a starting point? – Paul Gessler Jun 26 '14 at 19:18
  • I wish I had something more than the axis. – Y_gr Jun 26 '14 at 19:27
  • 1
    @giannis Even the axis is a start... at least we know what package you intend to use then :-) – darthbith Jun 26 '14 at 19:28
  • 1
    Even that would show that you've made some effort on top of posting an image of the desired result, and people will be much more likely to answer if you give them a starting point/framework. – Paul Gessler Jun 26 '14 at 19:29
  • Nothing very hard there for metapost except the ppt-style call outs. Just a question of drawing the graphs as part of one figure and connecting the related points with a draw ... dashed evenly. – Thruston Jun 26 '14 at 19:36
6

Here's something to get you started. I'd start from the bottom graph. Suppose total cost is

TC(Q) = 0.2Q^3 - 1.8Q^2 +6Q + 5

Then you can derive the formulae for the associated costs, and plot the bottom two graphs as I did below. A few things to note:

  • Instead of putting the graphs in different tikzpictures, put all of them into one, but within different scopes.
  • Draw lines between different diagrams as usual, as long as you have named coordinates. In this example, I named a coordinate mypoint at the intersection of MC and AVC (using the intersections library: see Sect 13.3.2 of the PGF Manual for details).
  • When price is 1, the image of the total product function is just a mirror image (wrt the 45 degree line) of the VC. So we can reuse the VC curve by flipping it about the horizontal axis, and then rotating it 90 degrees counter-clockwise. A similar trick can be used to draw the AP and MP curves.
  • Since the y-axis is scaled, it's hard to get the alignment of points of the TP and cost curves. (Perhaps you can play with xscale to get it right.) At any rate, it is misleading, if not entirely erroneous, to juxtapose the three graphs this way, because the TP graph and the cost graphs don't share the same horizontal axis.

Code

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{intersections}

\begin{document}

\begin{tikzpicture}[scale=.6,>=latex,font=\footnotesize,domain=0:7]
  %VC
  \draw[red,thick,yscale=.25] plot (\x,{.2*\x^3-1.8*\x^2+6*\x})
    node[right]{$VC$};
  %TC(x) = 0.2x^3 - 1.8x^2 +6x + 5
  \draw[thick,yscale=.25] plot (\x,{.2*\x^3-1.8*\x^2+6*\x+5})
    node[right]{$TC$};
  %FC
  \draw[thick,yscale=.25](0,5)--(7,5)
    node[right]{$FC$};
  \draw[<->](0,8)node[left]{$C$}--(0,0)--(8,0)node[below]{$Q$};

\begin{scope}[yshift=10cm,domain=1:7]
  %ATC
  \draw[thick,yscale=.6] plot (\x,{.2*\x^2-1.8*\x+6+5/\x})
    node[right]{$ATC$};
  %AVC
  \draw[thick,yscale=.6,name path global=avc] plot (\x,{.2*\x^2-1.8*\x+6})
    node[right]{$AVC$};
  %AFC
  \draw[orange,thick,yscale=.6] plot (\x,{5/\x})
    node[right]{$AFC$};
  %MC
  \draw[red,thick,yscale=.6,name path global=mc] plot (\x,{.6*\x^2-3.6*\x+6})
    node[right]{$MC$};
  \draw[<->](0,8)node[left]{$C$}--(0,0)--(8,0)node[below]{$Q$};
\end{scope}

  \draw[name intersections={of=mc and avc, by=mypoint},dashed](mypoint)--(mypoint|-0,0);

\begin{scope}[yshift=20cm]
  \begin{scope}[yscale=-1,rotate=-90]
    \draw[red,thick,yscale=.25] plot (\x,{.2*\x^3-1.8*\x^2+6*\x})
      node[right]{$TP$};
  \end{scope}  
  \draw[<->](0,8)node[left]{$Q$}--(0,0)--(8,0)node[below]{$L$};
\end{scope}

\end{tikzpicture}
\end{document}

Output

enter image description here

  • That's very useful. I just find difficult to make the the TP, AP, MP curves. Given that AP=TP/L, I don't have the result of like the second picture uploaded above. In addition how can I force it start (the curves of AP & MP) where x-axis is at point 1? – Y_gr Jul 3 '14 at 9:36
  • @giannis: you can draw AP and MP by flipping AC and MC curves. Just copy the AC/MC curves into the scope where the TP curve is drawn. The AC/MC curves already start at x=1. – Herr K. Jul 3 '14 at 14:42
  • Kevin, I've started with another scope so as to have the exact AC/MC curves. However, I do wonder how much should I rotate them? Even though they start at x=1, their shape is the opposite of what we need. – Y_gr Jul 3 '14 at 17:59
  • @giannis: Let's try the following. Copy the AC/MC curves into a separate scope, and add the following options to that scope: [domain=1:7,yscale=-1,yshift=-2.5cm], where you can play with the yshift values to get the curves to a desirable vertical position. If you want the AP/MP curves to start at the same point, then drop the domain key, and instead use xshift to move the curves to a desirable horizontal position. – Herr K. Jul 3 '14 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.