# How to show just part of a line

Simon shared this question 6 years ago

When I draw a line base on a function, I can't figure out how to just show part of the line. Eg. I only want to show where Y and X > 0. the proposed command is OK for the condition x> 0. If x and as well y have to be positive a supplementery condition for y is needed (it is not needed for y=3x-2 but it is for e.g. y=3x+2).

A solution for that line is f(x)=3x+2 and g(x)=If[f>0 && 0<x<=∞, f].

In both answers you'll notice that you have to cover the line by a function, in order to define the conditions.  1

1. %eg. line: y=3x-2
2. f(x) = If[0 < x ≤ ∞, 3x-2] 3

the proposed command is OK for the condition x> 0. If x and as well y have to be positive a supplementery condition for y is needed (it is not needed for y=3x-2 but it is for e.g. y=3x+2).

A solution for that line is f(x)=3x+2 and g(x)=If[f>0 && 0<x<=∞, f].

In both answers you'll notice that you have to cover the line by a function, in order to define the conditions.  1

Or also a simpler g(x)=If[f>0 && x>0, f]

(three keystrokes less - for lazy people :D ) 2

chi sa che un giorno a Linz una persona riuscira a creare valore piu largo che infinito...