gnuplot - Simple plot with pgfplots and LaTeX -
i've been searching hour on how draw simple function in latex, example f(x)=x^2. examples i've tried did not work unknown reason, because pdflatex not start gnuplot (the -enable-xxx options not work), found latex package works: pgfplots. problem documentation not contain simple example need. yes, if wanted draw complex diagrams whatnot might find something, simple example of function -- no luck! maybe need new glasses. please, i'd glad simple example of function plot in latex, x , y axis , graph!
edit: i've found best solution far, i'm not yet satisfied, example x label in middle. want standard plot without fancy colors or 3d or similar.
\begin{tikzpicture} \begin{axis}[     axis x line=bottom,     axis y line=middle,     xlabel=$x$,     ylabel={$x^2$},     xmin=-4, xmax=4,     ymin=0, ymax=4,     width=0.8\textwidth,     height=5cm ] \addplot[mark=noner,smooth,domain=-1:1]{x^2}; \end{axis} \end{tikzpicture} 
for simple functions don't need gnuplot, pgfplots able calculations in latex. see examples in section 4.2.4 of pgfplots manual; first example draws function x ↦ x² − 4.
Comments
Post a Comment