Graphics, Figures & TablesTikz Shading/Plot

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kapowza
Posts: 19
Joined: Fri Jan 30, 2009 3:32 pm

Tikz Shading/Plot

Post by kapowza »

I've been trying out Tikz recently and going through the manual. I understand that, to plot a function, I just use something like \draw plot function{x*x};

I was wondering - is there a relatively easy way to shade the region between the curve and the x-axis between, say, x = 1 and x = 2?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Tikz Shading/Plot

Post by localghost »

I guess the example from the pgf/tikZ manual (Part V - Utilities, p. 375) explains best what to do in this case. Call the manual on the command prompt of your machine.

Code: Select all

texdoc pgf

Best regards
Thorsten¹
Post Reply