# Logical function plotting software in Linux

I want to plot function like this.

if $x > 6000$ plot function $y = 6000+ \frac{x}{15}$ otherwise plot y = $6000$

Suggest me any open source plotting software that has linux version. I have tried KmPlot, KAlgebra, kst they does not seem to has such option.

KAlgebra supports ? ... : notation but when I enter, it says invalid syntax. If you know how to draw this funciton in

You should check out gnuplot. It is in almost any Linux repository.

Check out GNU Octave. This code should work out

if 3 > 4 ezplot('x^2 + y^2 = 25'); else ezplot('x^2/4 + y^2 = 36'); end

• I don't see how this answers OP's question, in which the condition is a function of x. – Robert Dodier May 23 '18 at 23:33

I'm late to the party, but for the record, one could use Maxima for this. Maxima constructs a plotting file and then calls Gnuplot, so it might be more convenient than calling Gnuplot directly.

Letting Gnuplot select the y range automatically:

plot2d (if x > 6000 then 6000 + x/15 else 6000, [x, 0, 10000]);


Specifying a y range:

plot2d (if x > 6000 then 6000 + x/15 else 6000, [x, 0, 10000], [y, 0, 11000]);