Created page with "== Arguments == {| class="wikitable" |- ! Argument !! Description !! Example !! Default |- | <u>Plots</u> || Plots as JSON || See #Example || |- | From || Lowest x,y to plot || <code>-pi/2,0</code> || <code>0,0</code> |- | <u>To</u> || Highest x,y to plot || <code>10^2,2</code> || |- | Origin || X/Y Axis origin || <code>0.5,0.5</code> || <code>0,0</code> |- | GridStep || Coordinate grid step size || <code>pi/2,1</code> || <code>1,1</code> |- | Inline || Display the..." |
→Arguments: Fix of y-axis labels changed defaults |
||
Line 19: | Line 19: | ||
| <s>LabelX, LabelY</s> || Axis label (not implemented) || || | | <s>LabelX, LabelY</s> || Axis label (not implemented) || || | ||
|- | |- | ||
| LabelStepX || Label for grid X-axis increments || <code>format("%sπ", dfrac(x/pi, 1))</code> || <code>format("% | | LabelStepX || Label for grid X-axis increments || <code>format("%sπ", dfrac(x/pi, 1))</code> || <code>format("%.0f", x)</code> | ||
|- | |- | ||
| LabelStepY || Label for grid X-axis increments || <code>format("%.1f", y)</code> || <code>format("% | | LabelStepY || Label for grid X-axis increments || <code>format("%.1f", y)</code> || <code>format("%.0f", y)</code> | ||
|- | |- | ||
| ColorX || X-axis color || <code>#44f</code> || <code>#f44</code> | | ColorX || X-axis color || <code>#44f</code> || <code>#f44</code> |
Latest revision as of 23:12, 12 February 2024
Arguments
Argument | Description | Example | Default |
---|---|---|---|
Plots | Plots as JSON | See #Example | |
From | Lowest x,y to plot | -pi/2,0 |
0,0
|
To | Highest x,y to plot | 10^2,2 |
|
Origin | X/Y Axis origin | 0.5,0.5 |
0,0
|
GridStep | Coordinate grid step size | pi/2,1 |
1,1
|
Inline | Display the plot inline instead of floating | true |
(absent) |
Axis label (not implemented) | |||
LabelStepX | Label for grid X-axis increments | format("%sπ", dfrac(x/pi, 1)) |
format("%.0f", x)
|
LabelStepY | Label for grid X-axis increments | format("%.1f", y) |
format("%.0f", y)
|
ColorX | X-axis color | #44f |
#f44
|
ColorY | Y-axis color | #0f4 |
#0f0
|
Underlined Arguments are required.
Available Functions and Constants in Expressions
printf(format, ...args)
See Lua string.format.dfrac(number, is_factor)
Formats a float as a fraction, if possible. If it is a factor, then the number 1 or -1 will only produce its sign as an output, useful when formatting as a factor of pi, for example. See #Example below.sin,floor,abs,...
Any constant or function from the Lua math library can be used directly (without themath.
prefix).
Example
{{#invoke:Plotter|Plot2D |From=-0.2, -1.2 |To=2 * pi + 0.2, 1.2 |GridStep=0.5 * pi, 1 |LabelStepX=format("%sπ", dfrac(x/pi, 1)) |Plots= [ {"Type": "function", "Function": "sin(x)", "Samples": 100, "Label": "sin"}, {"Type": "function", "Function": "cos(x)", "Samples": 100, "Label": "cos"}, {"Type": "function", "Function": "tan(x)", "Samples": 35, "Label": "tan", "Ranges": [ {"To": "(0.5-0.2)*pi"}, {"From": "(0.5+0.2)*pi", "To": "(1.5-0.2)*pi"}, {"From": "(1.5+0.2)*pi"} ]} ] }}
sincostan