A new feature in KDE 3.4 is that you can write scrips for KmPlot with DCOP. For example, if you want to define a new function f(x)=2sin x+3cos x
, set its line width to 20 and then draw it, you type in a console:
dcop kmplot-PID Parser addFunction "f(x)=2sin x+3cos x" As a result, the new function's id number will be returned, or -1 if the function could not be defined.
>dcop kmplot-PID Parser setFunctionFLineWidth 20 ID This command sets the function with the id number ID the line width to 20.
>dcop kmplot-PID View drawPlot This command repaints the window so that the function get visible.
A list over the available functions:
Load the file url
.
Returns true if any changes are done.
Opens the color edit dialog.
Opens the coordinate system edit dialog.
Opens the scaling edit dialog.
Opens the fonts edit dialog.
Opens the constants edit dialog.
Opens the new function plot dialog.
Opens the new parametric plot dialog.
Opens the new polar plot dialog.
Shows/hides parameter slider window number 1.
Shows/hides parameter slider window number 2.
Shows/hides parameter slider window number 3.
Shows/hides parameter slider window number 4.
Saves the functions (opens the save dialog if it is a new file).
The same as choosing -> in the menu.
Opens the edit plots dialog.
Opens the print dialog.
Opens the export dialog.
Opens the settings dialog.
Shows a list of predefined math functions.
Coordinate System I.
Coordinate System II.
Coordinate System III.
The same as choosing -> in the menu.
The same as choosing -> in the menu.
The same as choosing -> in the menu.
The same as choosing -> in the menu.
Adds a new function with the expression f_str
. If the expression does not contain a function name, it will be auto-generated. The id number of the new function is returned, or -1 if the function couln't be defined.
Removes the function with the id number id
. If the function could not be deleted, false is returned, otherwise true.
Sets the expression for the function with the id number id
to f_str
. Returns true if it succeed, otherwise false.
Returns the number of functions (parametric functions are calculated as two).
Returns a list with all functions.
Returns the id number of f_str
or -1 if the function name f_str
was not found.
Calculates the value x
for the function with the ID id
or returns 0.0 if id
does not exist.
Returns true if the function with the ID id
is visible, otherwise false.
Returns true if the first derivative of the function with the ID id
is visible, otherwise false.
Returns true if the second derivative of the function with the ID id
is visible, otherwise false.
Returns true if the integral of the function with the ID id
is visible, otherwise false.
Shows the function with the ID id
if visible
is true. If visible
is false, the function will be hidden. True is returned if the function exists, otherwise false
Shows the first derivative of the function with the ID id
if visible
is true. If visible
is false, the function will be hidden. True is returned if the function exists, otherwise false.
Shows the second derivative of the function with the ID id
if visible
is true. If visible
is false, the function will be hidden. True is returned if the function exists, otherwise false.
Shows the integral of the function with the ID id
if visible
is true. If visible
is false, the function will be hidden. True is returned if the function exists, otherwise false.
Returns the function expression of the function with the ID id
. If the function not exists, an empty string is returned instead.
Returns the color of the function with the ID id
.
Returns the color of the first derivative of the function with the ID id
.
Returns the color of the second derivative of the function with the ID id
.
Returns the color of the integral of the function with the ID id
.
Sets the color of the function with the ID id
to color
. True is returned if the function exists, otherwise false.
Sets the color of the first derivative of the function with the ID id
to color
. True is returned if the function exists, otherwise false.
Sets the color of the second derivative of the function with the ID id
to color
. True is returned if the function exists, otherwise false.
Sets the color of the integral of the function with the ID id
to color
. True is returned if the function exists, otherwise false.
Returns the line width of the function with the ID id
. If the function not exists, 0 is returned.
Returns the line width of the first derivative of the function with the ID id
. If the function not exists, 0 is returned.
Returns the line width of the first derivative of the function with the ID id
. If the function not exists, 0 is returned.
Returns the line width of the integral of the function with the ID id
. If the function not exists, 0 is returned.
Sets the line width of the function with the ID id
to linewidth
. True is returned if the function exists, otherwise false.
Sets the line width of the first derivative of the function with the ID id
to linewidth
. True is returned if the function exists, otherwise false.
Sets the line width of the second derivative of the function with the ID id
to linewidth
. True is returned if the function exists, otherwise false.
Sets the line width of the integral of the function with the ID id
to linewidth
. True is returned if the function exists, otherwise false.
Returns a list with all the parameter values for the function with the ID id
.
Adds the parameter value new_parameter
to the function with the ID id
. True is returned if the operation succeed, otherwise false.
Removes the parameter value remove_parameter
from the function with the ID id
. True is returned if the operation succeed, otherwise false.
Returns the minimum plot range value of the function with the ID id
. If the function not exists or if the minimum value is not definied, an empty string is returned.
Returns the maximum plot range value of the function with the ID id
. If the function not exists or if the maximum value is not definied, an empty string is returned.
Sets the minimum plot range value of the function with the ID id
to min
. True is returned if the function exists and the expression is valid, otherwise false.
Sets the maximum plot range value of the function with the ID id
to max
. True is returned if the function exists and the expression is valid, otherwise false.
Returns the initial x point for the integral of the function with the ID id
. If the function not exists or if the x-point-expression is not definied, an empty string is returned.
Returns the initial y point for the integral of the function with the ID id
. If the function not exists or if the y-point-expression is not definied, an empty string is returned.
Sets the initial x point for the integral of the function with the ID id
to x
. True is returned if the function exists and the expression is valid, otherwise false.
Sets the initial y point for the integral of the function with the ID id
to y
. True is returned if the function exists and the expression is valid, otherwise false.
If KmPlot currently is drawing a function, the procedure will stop.
Redraws all functions.
Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team