GeneralPlotting Inequalities on a number Line

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Jonny Boy
Posts: 7
Joined: Mon Feb 05, 2007 4:54 pm

Plotting Inequalities on a number Line

Post by Jonny Boy »

When you solve two inequalities, such as x>4 and x<=6, you'd draw them on a number line, one above the other.
Using the interval command (in the cooordsys package), you can plot them on a number line, but if you put two interval commands, they are plotted one on top of the other. Can you plot them one above the other, like you would on paper?

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Plotting Inequalities on a number Line

Post by Stefan Kottwitz »

Hi Jonny,

that could be done by \raisebox:

Code: Select all

\raisebox{1ex}{\interval[...)}
Stefan
LaTeX.org admin
Jonny Boy
Posts: 7
Joined: Mon Feb 05, 2007 4:54 pm

Re: Plotting Inequalities on a number Line

Post by Jonny Boy »

Thanks Stefan,
But the region appears to be further right than it should be.

If you put a region on the line, and then repeat it above with the raisebox command, then the line is in the right place.

However, if you then attempt two regions, one above the other, then at least one is out of place.

Obviously, I could put in smaller values, so it appears in the right place, but this isn't ideal.
Post Reply