How to change line style based on x value?

asmarcz shared this question 9 months ago
Answered

Hi,

for function f: y=x I'd like to show part of line as dashed and part of line as solid. I tried this:


If(0<=x, SetLineStyle(f, 1), SetLineStyle(f, 0))
That didn't work. Please note I'd like to do similar for more tedious functions and seeked solution is not to split function into multiple parts with different domains.

Comments (2)

photo
1

if you want two styles you must create two objects


ie: if(x>=0 ,x)

if(x<=0 , x) and then select the style for each one

photo
1

Thank you

photo
© 2020 International GeoGebra Institute