CurveFittingOptions

CurveFittingOptions ( seriesIndex ;​ type ;​ doSwitchAxes ;​ doExtrapolate ;​ doForceThruZero ;​ numOfpSplineIntervals )

Argument Type Range Default Note
seriesIndex int 0..10000 all
type int -5..6 linear
doSwitchAxes int 0..1 off
doExtrapolate int 0..1 off
doForceThruZero int 0..1 off
numOfpSplineIntervals int 10..1000 100
Examples

CurveFittingOptions(all;​1;​;​on)

CurveFittingOptions(1;​2;​off;​on;​on)

Description

The CurveFittingOptions() function makes it possible to vary the way in which the curves are calculated and drawn. By activating the argument doSwitchAxes = on, the coordinates of the points used to calculate the curves are switched.

CURVE_FITTING_OPTIONS_01
1

OpenDrawing(250;​150)

2

ChartData(54 93 7 69 70;​ /* x-values. */

3

29 52 70 67 95) /* y-values. */

4

ScatterChart2D()

5

CurveFitting(1;​2)

6

CurveFittingLineStyle(1;​2;​1.5;​#c002a0)

7

CurveFittingOptions(1;​2;​on)

8

/* Set up styles. */

9

SymbolStyle(1;​bullet;​4;​1;​#4682b4;​shaded)

10

/* Set up axes. */

11

AxisLine(all;​0)

12

AxisMajorTicks(all;​0)

13

/* Set up grid. */

14

MajorGridLineWidths(all;​all;​0.25)

15

GridFrame(xy;​0.5;​#888)

16

CloseDrawing()

CURVE_FITTING_OPTIONS_01

By activating the argument doExtrapolate = on, curves can be extended to the border of the graph.

CURVE_FITTING_OPTIONS_02
1

OpenDrawing(250;​150)

2

ChartData(54 93 7 69 70;​ /* x-values. */

3

29 52 70 67 95) /* y-values. */

4

ScatterChart2D()

5

CurveFitting(1;​2)

6

CurveFittingLineStyle(1;​2;​1.5;​#c002a0)

7

CurveFittingOptions(1;​2;​on;​on)

8

/* Set up styles. */

9

SymbolStyle(1;​bullet;​4;​1;​#4682b4;​shaded)

10

/* Set up axes. */

11

AxisLine(all;​0)

12

AxisMajorTicks(all;​0)

13

/* Set up grid. */

14

MajorGridLineWidths(all;​all;​0.25)

15

GridFrame(xy;​0.5;​#888)

16

CloseDrawing()

CURVE_FITTING_OPTIONS_02
CURVE_FITTING_OPTIONS_03
1

OpenDrawing(250;​150)

2

ChartData(54 93 7 69 70 90 33 53 80 33;​ /* x-values. */

3

5 59 76 24 47 29 52 70 67 95) /* y-values. */

4

ScatterChart2D()

5

CurveFitting(1;​exp)

6

CurveFittingLineStyle(1;​exp;​0.75;​#c002a0)

7

CurveFittingOptions(1;​exp;​;​on)

8

/* Set up styles. */

9

SymbolStyle(1;​bullet;​4;​1;​#4682b4;​shaded)

10

/* Set up axes. */

11

Scaling(y;​linear;​0;​100;​5)

12

AxisLine(all;​0)

13

AxisMajorTicks(all;​0)

14

/* Set up grid. */

15

MajorGridLineWidths(all;​all;​0.25)

16

GridFrame(xy;​0.5;​#888)

17

CloseDrawing()

CURVE_FITTING_OPTIONS_03

Polynomial functions run through the coordinate origin if the argument doForceThruZero = on is set. For all other curve functions the argument doForceThruZero is ignored.

CURVE_FITTING_OPTIONS_04
1

OpenDrawing(250;​150)

2

ChartData(57 108 70 125 116 13 43 67 45 121 181 189 195 166 115 105;​ /* x-values. */

3

35 99 72 139 90 69 85 162 210 211 256 304 258 274 270 263) /* y-values. */

4

ScatterChart2D()

5

CurveFitting(1;​linear)

6

CurveFittingLineStyle(1;​linear;​1 12 3;​#c002a0)

7

CurveFittingOptions(1;​linear;​;​on;​on)

8

/* Set up styles. */

9

SymbolStyle(1;​bullet;​4;​1;​#4682b4;​shaded)

10

/* Set up axes. */

11

AxisLine(all;​0)

12

AxisMajorTicks(all;​0)

13

/* Set up grid. */

14

MajorGridLineWidths(all;​all;​0.25)

15

GridFrame(xy;​0.5;​#888)

16

CloseDrawing()

CURVE_FITTING_OPTIONS_04
CURVE_FITTING_OPTIONS_05
1

OpenDrawing(250;​150)

2

ChartData(57 108 70 125 116 13 63 67 45 121 181 189 201 166 115 105 91 75 99 72 33 29 69 85 162 210 211 256 304 258 274 270 263;​

3

233 229 269 285 362 410 411 456 504 458 474 470 463 257 308 270 325 316 213 263 267 245 321 381 389 401 366 315 305 291 275 299 272)

4

ScatterChart()

5

CurveFittingLineStyle(1;​1;​0.75;​#4682b4)

6

CurveFittingLineStyle(2;​4;​0.75;​#c002a0)

7

CurveFittingOptions(1;​1;​;​on;​on)

8

CurveFittingOptions(2;​4;​;​on;​on)

9

/* Set up styles. */

10

SymbolStyle(1;​bullet;​3;​1;​#4682b4)

11

SymbolStyle(2;​bullet;​3;​1;​#c002a0)

12

/* Set up axes. */

13

AxisOptions(x;​none) /* Hide x-axis. */

14

AxisLine(y;​0)

15

AxisMajorTicks(y;​0)

16

/* Set up grid. */

17

MajorGridLineWidths(x;​y;​0.25)

18

MajorGridLineWidths(y;​x;​0)

19

CloseDrawing()

CURVE_FITTING_OPTIONS_05
CURVE_FITTING_OPTIONS_06
1

OpenDrawing(250;​150)

2

ChartData(64 23 14 69 70 94 43 56 85 45)

3

ScatterChart(;​on)

4

CurveFittingLineStyle(1;​2;​4;​#4682b470)

5

CurveFittingOptions(1;​2;​off;​on;​on)

6

/* Set up styles. */

7

SymbolStyle(1;​circle;​5;​1;​#4682b4)

8

/* Set up axes. */

9

AxisOptions(x;​none) /* Hide x-axis. */

10

AxisLine(y;​0)

11

AxisMajorTicks(y;​0)

12

/* Set up grid. */

13

MajorGridLineWidths(x;​y;​0.25)

14

MajorGridLineWidths(y;​x;​0)

15

CloseDrawing()

CURVE_FITTING_OPTIONS_06

The smoothing of P-splines (argument type = pSpline) can be controlled by using the argument numOfpSplineIntervals. For all other curve functions the argument numOfpSplineIntervals is ignored.

CURVE_FITTING_OPTIONS_07
1

OpenDrawing(250;​150)

2

OpenChart(5;​0;​240;​120)

3

ChartData(57 108 70 125 116 13 63 67 45 121 181 189 201 166 115 105 91 75 99 72 33 29 69 85 162 210 211 256 304 258 274 270 263;​

4

57 108 70 125 116 13 63 67 45 121 181 189 201 166 115 105 91 75 99 72 33 29 69 85 162 210 211 256 304 258 274 270 263)

5

ScatterChart()

6

CurveFittingLineStyle(1;​pSpline;​4;​#4682b450)

7

CurveFittingLineStyle(2;​pSpline;​1 10 4;​#c002a0)

8

CurveFittingOptions(1;​pSpline;​;​;​;​200)

9

CurveFittingOptions(2;​pSpline;​;​;​;​30)

10

/* Set up styles. */

11

SymbolStyle(1;​bullet;​3;​1;​#4682b4)

12

SymbolStyle(2;​none)

13

/* Set up axes. */

14

AxisOptions(x;​none) /* Hide x-axis. */

15

AxisLine(y;​0)

16

AxisMajorTicks(y;​0)

17

/* Set up grid. */

18

MajorGridLineWidths(x;​y;​0.25)

19

MajorGridLineWidths(y;​x;​0)

20

CloseChart()

21

/* Legend */

22

OpenView(45;​110;​180;​35)

23

AddLine(10;​10;​50;​10;​4;​#4682b450)

24

AddLine(10;​25;​50;​25;​1 10 4;​#c002a0)

25

AddText(55;​10;​"200 P-spline intervals";​Verdana;​9;​bold;​#444;​left;​center)

26

AddText(55;​25;​" 30 P-spline intervals";​Verdana;​9;​bold;​#444;​left;​center)

27

CloseView()

28

CloseDrawing()

CURVE_FITTING_OPTIONS_07
Scroll to Top