I'm looking for a way to create the following graph coordinate in LyX.

enter image description here

Which package should I use and How should I approach this problem? I read some prevoius threads on how to do such things and I came across with tikzpicture. I read the docs but I didn't see any example on how to create similir things. Is it posssbile with tikz?

  • 2
    Try \documentclass[tikz,border=3.14mm]{standalone} \begin{document} \begin{tikzpicture} \draw[-stealth] (-0.5,0) -- (5,0) node[right]{$Q_x$}; \draw[-stealth] (0,-0.5) -- (0,5) node[above]{$P_x$}; \draw[dashed] (2.2,3) -- (-0.25,3) node[left]{$P_0$}; \draw (1,4) to[out=-70,in=160] (3,1) node[left=1cm]{$D(\overline{P}_y,\overline{T},I_0)$}; \draw (2,4) to[out=-70,in=155] (3.5,1) node[above right]{$\dots$}; \end{tikzpicture} \end{document} – user121799 Feb 4 '19 at 19:21

marmot already gave you a code sample in his comment, but since you're using LyX maybe you need to know how to insert it in it.

Open your document and choose Document --> Settings --> LaTeX preamble and add

\usetikzlibrary{intersections, positioning}

and click on OK.

Then choose Insert --> TeX code (or click on Ctrl+L) and insert this code where the cursor is:

\draw[->] (-0.5,0) -- (5,0) node[right]{$Q_x$}; 
\draw[->] (0,-0.5) -- (0,5) node[above]{$P_x$}; 
\draw[name path=firstdemand] (.5,4.5) parabola[bend at end] (4,.5) node[above left=7pt and 44pt] {$D(\overline{P}_y,\overline{T},I_0)$};
\draw[name path=demand] (1.5,4.5) parabola[bend at end] (5,1) node[above right=14pt and -34pt] {$D(\overline{P}_y,\overline{T},I_1>I_0)$};
\path[name path=line] (0,3) -- (4,3);
\path [name intersections={of=demand and line,by=mypoint}];
\draw[dashed] (-.3,3) node[left] {$P_0$} -- (mypoint);
\path[name path=lowline] (0,2.5) -- (4,2.5);
\path [name intersections={of=firstdemand and lowline,by=mylowpoint}];
\draw[thick, ->] (mylowpoint) -- ++(.7,0);

(my code is a little different from marmot's one).

Then click on View, and you'll get this result:

enter image description here

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.