FG
💻 Software

How do I define a function in parts for plotting?

Fresh5 days ago
Mar 15, 202618844 views
Confidence Score0%
0%

Problem

I use gnuplot for plotting functions. This is my script at the moment: f(x), g(x) and h(x) are one function: -infinity < x < 0.8 : f(x) 0.8 <= x < 0.93 : g(x) 0.93 <= x < +infinity: h(x) How can I do this?

Error Output

set terminal png xffffff x222222
set output "Ausgleichszahlungen.png"
set title "Ausgleichszahlungen"
set xlabel 'F_MZ / A_MZ'
set ylabel 'Faktor F'
…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How do I define a function in parts for plotting?

Low Risk

Change the last line to I find that easy to read, but it has the disadvantage that all f(x), g(x) and h(x) will always be evaluated. You can also use the ternary conditional operator: will evaluate to if is true and to if is false. You can nest thos…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment