curiouslearn wrote:Thanks very much for the information phi. You mentioned that gnuplot is limited by itself. Do you mean that asymptote is better at plotting functions compared to gnuplot?
Yes, definitely. Gnuplot can plot real-valued functions of one or two real variables in a specified range—nothing more, nothing less. The main objective of Gnuplot is to plot experimental data with error bars and do curve fitting. If you want contour plots or functions of complex arguments, Gnuplot is not the right tool. Sure, you can always expression complex arguments by real ones, but it is easier if the language supports built-in complex arithmetic. But for (possibly parameterized) real-valued functions of one real variable, Ti
kZ is sufficient and there is no advantage in using Gnuplot.
curiouslearn wrote:I love TikZ and think its a great package. However, recently when preparing some slides, I found that I could not use it to plot some functions that I would have liked. I know that I can use gnuplot, but I am not familiar with it and would have to learn it.
No, Ti
kZ is able to control Gnuplot without user interaction. It writes a Gnuplot script and executes it. The script tells Gnuplot to produce a data file with x and y values for the given function. This data file is in turn read in and plotted by Ti
kZ. The only thing that Gnuplot really does is evaluating the function at some points—the mathematical capabilities in TeX are not strong enough for this. So you don't have to learn anything, just instruct Ti
kZ to use Gnuplot. Have a look at the section "Plots of Functions" of the PGF/Ti
kZ manual for an exhaustive discussion and some examples.
curiouslearn wrote:I am asking all these questions because I am wondering whether I should spend time learning gnuplot or learning asymptote instead.
If you are familiar with Ti
kZ and have been using it to produce your figures until now, I would suggest to continue using it. It is a very sophisticated package that offers great opportunities. If you don't need the capabilities of Asymptote (like complex arithmetics, numerical computations etc.), Ti
kZ is sufficient. Learning Gnuplot wouldn't really help in your case. Although it is quite popular among physicists (because you can draw plots for experimental data without much programming), its results are of low quality compared to those of Ti
kZ (this is also discussed in the aforementioned section of the PGF manual; another valuable discussion is contained in the section "Guidelines on Graphics") and its capabilities of drawing error bars and doing curve fitting are not needed when you just want to draw some function graphs.
On the other hand, Asymptote is not very easy to learn, partially because the syntax is quite terse, partially because the manual is not very extensive. If you just want plots for real-valued functions of one real variable and you already know how to use Ti
kZ, it would be overkill to learn all the bells and whistles of Asymptote.
curiouslearn wrote:I am not sure about the correct technical term. But by "directly" I meant that can it be used with PDFLatex just like TikZ. For example, I have heard that when using "pstricks" one has to first produce DVI->PS->PDF. Does asymptote require similar steps? From your answer below it seems that this is not the case.
Yes, that's right. PSTricks needs PostScript output because it relies on features of PostScript that are not offered by PDF. Asymptote is (like Gnuplot and MetaPost) an external program that takes a separate input file and compiles it to a vector graphics file (e.g., PDF or EPS), which in turn is included using \includegraphics. PSTricks and Ti
kZ, on the other hand, use environments inside the LaTeX document without external files or programs. Both methods have their pros and cons, but for the quality of the result, this should not make a difference.
To summarize it, my suggestion is that you continue using Ti
kZ, and let it call Gnuplot for you.