Graphics, Figures & TablesGraphing Inequalties

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Mikerada6
Posts: 42
Joined: Fri Oct 17, 2008 5:55 pm

Graphing Inequalties

Post by Mikerada6 »

How would I create a graph of an inequality in latex? I want to be able to graph a problem such as x>5 or x<=7. If it has two variables such as x-y<9 I can use maple to graph it and then export the image. However maple is unable to graph a simple one variable inequality. Are there any packages that could be used to create a number line and then add the correct information such as open/close circles, shaded the correct side and the appropriate numbers along the bottom?

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

Mini
Posts: 73
Joined: Thu Aug 06, 2009 12:46 pm

Re: Graphing Inequalties

Post by Mini »

Pstricks.
ronbannon
Posts: 7
Joined: Mon May 05, 2014 4:49 pm

Re: Graphing Inequalties

Post by ronbannon »

I too would like to do this. Ideally, I'd love to enter an interval, including unions of intervals, and have a default number line graph generated. Or, even better, have some way to take a single variable inequality and auto generate a graphical solution. Usually I just generate a pdf graph and then include the image, but that's a lot of work and I am looking for a better way.

Does anyone have an idea how to code this?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Graphing Inequalties

Post by Stefan Kottwitz »

I would use TikZ or pgfplots for this. Both can fill the area under a line or a curve, even between given curves. See filling plots for examples, lines or inequalities would even be easier than complex curves.

Stefan
LaTeX.org admin
Post Reply