3
$\begingroup$

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

3 Answers 3

5

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

  • 0
    I have solved it by using [these commands](http://pastie.org/4177253). Now I want to know how can I keep the axis not messed up.2012-06-30
2

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

  • 0
    I don't see how this answers OP's question, in which the condition is a function of `x`.2018-05-23
0

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]);