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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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