DensityPlot

New in version 5.0

DensityPlot ( appearanceConst ;​ numOfGridPointsHorizontal ;​ numOfGridPointsVertical ;​ arrangeColumnByColumn ;​ margins )

Argument Type Range Default Note
appearanceConst int 0..127 default
numOfGridPointsHorizontal int 2..100000 (autom.)
numOfGridPointsVertical int 2..100000 (autom.)
arrangeColumnByColumn int 0..1 off
margins num[] 0..0.5 0.5
Examples

DensityPlot(symbol+label;​9;​5;​1;​0.5)

DensityPlot(default;​25;​16)

Description

Two functions are available to set up density plots: DensityPlot() and DensityPlotOptions() . The appearance of the density can be controlled by the FillColorScale() functions, the labels by using the five style functions LabelTexts() , LabelStyle() , LabelBackground() , LabelBackgroundOptions() and LabelOptions() . By using the function BorderStyle() the appearance of the border around the density plot can be controlled.

DENSITY_PLOT_01
1

OpenDrawing(500;​300)

2

ChartData(2 5 4 1 2 1 9 1 1

3

3 1 -1 1 0 -1 -8 -4 0

4

-1 -3 -3 3.5 -2 -1.5 8 -1 0

5

-2 -1 0 -5.5 -2.5 0.5 -9 -4 1

6

-2 -1 0 -5.5 -2.5 0.5 -9 -4 1)

7

DensityPlot(symbol+label;​9;​5;​1;​0.5)

8

DensityPlotOptions(0.25 5 5;​#666)

9

FillColorScale(1;​-14)

10

SymbolStyle(1;​bullet;​4;​0.25;​#666)

11

LabelStyle(1;​Arial;​9)

12

LegendTitle("Temp.";​Arial;​11;​plain;​#333;​;​5)

13

LegendStyle(Verdana;​10)

14

LegendOptions(centerRight;​

15

0;​ /* Place legend inside of plot area. */

16

6;​ /* Horizontal offset.  */

17

0;​ /* Vertical offset.  */

18

1;​ /* Number of rows (ignored).  */

19

0;​ /* Legend item type (ignored).  */

20

15;​ /* Color scale width.  */

21

150;​ /* Color scale height.  */

22

3;​ /* Gap between text and ticks.  */

23

0;​ /* Row gap (ignored).  */

24

0;​ /* Column gap (ignored).  */

25

6) /* Text location.  */

26

LegendColorScale(-8 -4 0 4 8;​ /* Scale values.  */

27

1;​ /* Do reverse scale. */

28

5;​ /* Scale inset.  */

29

6;​ /* Tick length.  */

30

0;​ /* Tick offset.  */

31

1;​ /* Tick stroke.  */

32

#333;​ /* Tick color.  */

33

1;​ /* Do mirror ticks.  */

34

3;​ /* Num of sub-ticks. */

35

3;​ /* Sub-tick length.  */

36

"|u|";​ /* Label format.  */

37

1;​ /* Border stroke.  */

38

#333) /* Border color.  */

39

CloseDrawing()

DENSITY_PLOT_01
DENSITY_PLOT_02
1

OpenDrawing(500;​380)

2

OpenChart(20;​20;​460;​300;​on)

3

ChartData(236 310 -391 181 318 -338 -176 -194 -169 429 -455 401 174 98 -114 -405 -372 441 -494 -423 361 187 54 -269 330 -311 -428 172 -200 -359 -436 415 472 238 50 180 389 445 -209 358 -70 -410 72 352 -464 216 -395 -473 -314 391 -192 -212 289 379 280 193 -10 -85 -492 -461 349 -110 -134 -73 480 422 459 -213 198 -203 -67 -306 278 160 -285 -434 174 -411 176 -392 487 370 249 -65 -147 16 -109 1 -201 -481 399 -430 -16 -87 222 -484 20 -210 272 46 345 -342 -312 306 -36 12 76 132 33 -32 314 -390 354 -393 302 331 -24 -222 -460 110 262 -138 59 -469 317 83 -450 134 241 -335 -225 -491 439 419 467 74 -275 459 288 276 187 126 -332 -15 -136 -414 275 91 329 -307 432 -81 -261 390 117 -440 -16 388 177 -310 134 338 415 358 -493 260 66 -59 -60 -252 -423 375 -460 -239 20 -184 -36 344 180 157 83 -244 158 401 399 -120 293 0 292 -321 -170 471 444 -83 -296 189 -12 345 -456 -132 -205 434 -203 44 361 158 -344 396 40 -289 -295 459 -1 489 -11 -253 133 -88 -260 -212 -235 154 365 -149 496 331 286 25 -395 -484 5 301 -382 -418 297 -224 339 -218 98 354 -272 -479 292 -394 0 -356 95 180 -203 49 427 -7 463 -332 447 -168 -155 -128 -286 257 484 471 -7 -198 -147 -33 467 -181 491 -156 -133 -270 415 -476 207 -43 61 306 -136 289 -352 168 -228 9 293 -273 150 -359 -292 292 -97 317 367 297 -500 -34 -144 -100 66 283 -488 37 289 261 -266 -104 486 475 423 -473 -80 -359 -43 -255 429 -80 56 -480 387 -191 294 365 -385 -162 -483 -473 -243 -341 -385 63 -127 -493 296 77 234 317 220 134 -31 247 495 164 -101 -321 359 -96 345 400 207 -462 191 285 -142 45 -368 211 273 -267 -142 372 -458 494 113 478 -100 -475 -438 -8 -234 1 -293 -424 -485 99 -316 194 -375 -386 66 -277 -204 319 379 445 -495 313 497 310 286 297 228 84 413 -233 347 402 -149 177 -34 114)

4

DensityPlot(default;​25;​16)

5

DensityPlotOptions(0.25;​white)

6

Borderstyle(1;​;​3;​#888)

7

FillColorScale(1;​25)

8

/* Set up legend. */

9

LegendStyle(Verdana;​10)

10

LegendOptions(bottomCenter;​

11

0;​ /* Place legend inside of plot area. */

12

0;​ /* Horizontal offset.  */

13

10;​ /* Vertical offset.  */

14

1;​ /* Number of rows (ignored).  */

15

0;​ /* Legend item type (ignored).  */

16

400;​ /* Color scale width.  */

17

12;​ /* Color scale height.  */

18

3;​ /* Gap between text and ticks.  */

19

0;​ /* Row gap (ignored).  */

20

0;​ /* Column gap (ignored).  */

21

bottomCenter) /* Text location.  */

22

LegendColorTones(-500;​ /* Scale value Min.  */

23

500;​ /* Scale value Max.  */

24

10;​ /* Number of color tones.  */

25

0;​ /* Do reverse scale.  */

26

0) /* Gap between color tones. */

27

CloseChart()

28

CloseDrawing()

DENSITY_PLOT_02
DENSITY_PLOT_03
1

OpenDrawing(500;​380)

2

OpenChart(20;​60;​460;​300;​on)

3

ChartData(-300 300 -500 -400 -300 -200 -100 0 100 200 300

4

400 -400 -300 200 -100 0 100 200 300 400 500

5

-300 -500 -400 -300 -200 -100 0 100 200 300 400

6

300 0 -500 -400 -300 -200 -100 0 -500 0 300

7

400 100 500 -500 -400 -300 -200 -100 0 100 200)

8

DensityPlot(symbol;​11;​5)

9

DensityPlotOptions(0) /* Hide grid. */

10

Borderstyle(1;​;​1;​#888)

11

SymbolStyle(1;​plus;​5;​1;​#f88)

12

FillColorScale(1;​11;​;​;​30)

13

/* Set up legend. */

14

LegendTitle("Density";​Verdana;​16;​plain;​#666;​;​8)

15

LegendTexts("Less";​;​;​;​;​;​;​;​;​"More")

16

LegendStyle(Verdana;​10)

17

LegendOptions(topCenter;​

18

0;​ /* Place legend inside of plot area. */

19

0;​ /* Horizontal offset.  */

20

-3;​ /* Vertical offset.  */

21

1;​ /* Number of rows (ignored).  */

22

0;​ /* Legend item type (ignored).  */

23

250;​ /* Color scale width.  */

24

12;​ /* Color scale height.  */

25

5;​ /* Gap between text and ticks.  */

26

0;​ /* Row gap (ignored).  */

27

0;​ /* Column gap (ignored).  */

28

centerLeft;​ /* Text location.  */

29

2) /* Shape: 1...rect, 2..oval.  */

30

LegendColorTones(-500;​ /* Scale value Min.  */

31

500;​ /* Scale value Max.  */

32

10;​ /* Number of color tones.  */

33

0;​ /* Do reverse scale.  */

34

1) /* Gap between color tones. */

35

CloseChart()

36

CloseDrawing()

DENSITY_PLOT_03

See also functions LegendColorScale() and LegendColorTones() .
For more examples, please refer to Color Scales.

Scroll to Top