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

$\endgroup$
5
$\begingroup$

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

| cite | improve this answer | |
$\endgroup$
2
$\begingroup$

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

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ I don't see how this answers OP's question, in which the condition is a function of x. $\endgroup$ – Robert Dodier May 23 '18 at 23:33
0
$\begingroup$

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]);
| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.