General ⇒ Create a Consumer-Surplus-kind of diagram
-
- Posts: 1
- Joined: Fri Oct 26, 2007 2:11 pm
Create a Consumer-Surplus-kind of diagram
If you don't know what I mean, here's an example:
http://en.wikipedia.org/wiki/Consumer_surplus
I don't need anything as fancy as that, I only need some linear lines and don't need color. What I basically need is something that makes a diagram with two axes, a couple of lines and I need to fill a part of the graph.
Thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Create a Consumer-Surplus-kind of diagram
Regards,
B.A.
Create a Consumer-Surplus-kind of diagram
Re: Create a Consumer-Surplus-kind of diagram
dvips -E -o"mygraphicfile.eps"
(under some editors such as WinEdt under windows) this can be automated with a macro).
Finally, I convert the .eps file to a .pdf via eps2pdf (a special interface to ghostscript, which allows to easily convert several files at a time).
To have your figures in the main document, you just have to add the lines:
\beginfigure[!h]
\centering %% if you want to center, of course!
\includegraphics{mygraphicfile}%% no extension!
\end{figure}
This way: 1) you can re-use your file in other documents if necessary; 2) you can either compile with latex (the .eps file will be automatically chosen) or with pdflatex (the .pdf file will be) 3) pstricks has an advantage: there is a command '\psset{unit=...}'; using it, you can scale your figure, without scaling the text contained in it.
To obtain eventually an .eps figure, you must load the extensions pstricks.sty and pst-eps.sty; the description of you figure must be between the following commands:
\TeXtoEPS and \endTeXtoEPS. Here's a simple example, which draws two coordinates axes Ox,Oy:
\TeXtoEPS
\pspicture(-3,-3)(3,3)
\psaxes(0,0)(-3,-3)(3,3)%%the two axes intersect at (0,0), x and y go from -3 to 3
\uput[dl](0,0){$O}\uput[dl](3,0){$x$}\uput[dl](0,3){$y$}
\endpspicture
\endTeXtoEPS