This file is indexed.

/usr/share/doc/veusz/manual.html is in veusz 1.21.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Veusz - a scientific plotting package</title><link rel="stylesheet" type="text/css" href="manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book"><div class="titlepage"><div><div><h1 class="title"><a name="idp46230704"></a>Veusz - a scientific plotting package</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="surname">Sanders</span></h3><code class="email">&lt;<a class="email" href="mailto:jeremy@jeremysanders.net">jeremy@jeremysanders.net</a>&gt;</code></div></div><div><p class="copyright">Copyright © 2014 </p></div><div><div class="legalnotice"><a name="idp46234816"></a><p>
	This document is licensed under the GNU General Public
	License, version 2 or greater. Please see the file COPYING for
	details, or see <a class="ulink" href="http://www.gnu.org/licenses/gpl-2.0.html" target="_top">http://www.gnu.org/licenses/gpl-2.0.html</a>.</p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="chapter"><a href="#idp46268816">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#idp46269456">1. Veusz</a></span></dt><dt><span class="section"><a href="#idp46272768">2. Terminology</a></span></dt><dd><dl><dt><span class="section"><a href="#idp46273824">2.1. Widget</a></span></dt><dt><span class="section"><a href="#idp46183680">2.2. Settings: properties and formatting</a></span></dt><dt><span class="section"><a href="#idp46187600">2.3. Text</a></span></dt><dt><span class="section"><a href="#idp50475040">2.4. Measurements</a></span></dt><dt><span class="section"><a href="#idp48945696">2.5. Axis numeric scales</a></span></dt></dl></dd><dt><span class="section"><a href="#idp50264784">3. Installation</a></span></dt><dt><span class="section"><a href="#idp48946656">4. The main window</a></span></dt><dt><span class="section"><a href="#idp50897936">5. My first plot</a></span></dt></dl></dd><dt><span class="chapter"><a href="#idp50908784">2. Reading data</a></span></dt><dd><dl><dt><span class="section"><a href="#idp50917456">1. Standard text import</a></span></dt><dd><dl><dt><span class="section"><a href="#idp50922480">1.1. Data types in text import</a></span></dt><dt><span class="section"><a href="#idp50927472">1.2. Descriptors</a></span></dt></dl></dd><dt><span class="section"><a href="#idp50946592">2. CSV files</a></span></dt><dt><span class="section"><a href="#idp50950432">3. HDF5 files</a></span></dt><dd><dl><dt><span class="section"><a href="#idp50954816">3.1. Error bars</a></span></dt><dt><span class="section"><a href="#idp50956944">3.2. Slices</a></span></dt><dt><span class="section"><a href="#idp50962112">3.3. 2D data ranges</a></span></dt><dt><span class="section"><a href="#idp50964080">3.4. Dates</a></span></dt></dl></dd><dt><span class="section"><a href="#idp50969392">4. 2D text or CSV format</a></span></dt><dt><span class="section"><a href="#idp50990560">5. FITS files</a></span></dt><dt><span class="section"><a href="#idp50996512">6. Reading other data formats</a></span></dt><dt><span class="section"><a href="#idp51003472">7. Manipulating datasets</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51005008">7.1. Using dataset plugins</a></span></dt><dt><span class="section"><a href="#idp51006928">7.2. Using expressions to create new datasets</a></span></dt><dt><span class="section"><a href="#idp51018208">7.3. Linking datasets to expressions</a></span></dt><dt><span class="section"><a href="#idp51019552">7.4. Splitting data</a></span></dt><dt><span class="section"><a href="#idp51022320">7.5. Defining new constants or functions</a></span></dt><dt><span class="section"><a href="#idp51025744">7.6. Dataset plugins</a></span></dt></dl></dd><dt><span class="section"><a href="#idp51027808">8. Capturing data</a></span></dt></dl></dd><dt><span class="chapter"><a href="#idp51035584">3. Command line interface</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51036720">1. Introduction</a></span></dt><dt><span class="section"><a href="#idp51044016">2. Commands</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51045040">2.1. Action</a></span></dt><dt><span class="section"><a href="#idp51047648">2.2. Add</a></span></dt><dt><span class="section"><a href="#idp51055552">2.3. AddCustom</a></span></dt><dt><span class="section"><a href="#idp46085808">2.4. AddImportPath</a></span></dt><dt><span class="section"><a href="#idp46088432">2.5. CloneWidget</a></span></dt><dt><span class="section"><a href="#idp46091184">2.6. Close</a></span></dt><dt><span class="section"><a href="#idp51076640">2.7. CreateHistogram</a></span></dt><dt><span class="section"><a href="#idp51079824">2.8. DatasetPlugin</a></span></dt><dt><span class="section"><a href="#idp51082496">2.9. EnableToolbar</a></span></dt><dt><span class="section"><a href="#idp51085040">2.10. Export</a></span></dt><dt><span class="section"><a href="#idp51093872">2.11. ForceUpdate</a></span></dt><dt><span class="section"><a href="#idp51096512">2.12. Get</a></span></dt><dt><span class="section"><a href="#idp51099920">2.13. GetChildren</a></span></dt><dt><span class="section"><a href="#idp51102416">2.14. GetClick</a></span></dt><dt><span class="section"><a href="#idp51105536">2.15. GetData</a></span></dt><dt><span class="section"><a href="#idp51109696">2.16. GetDataType</a></span></dt><dt><span class="section"><a href="#idp51112272">2.17. GetDatasets</a></span></dt><dt><span class="section"><a href="#idp51114752">2.18. GPL</a></span></dt><dt><span class="section"><a href="#idp51117232">2.19. ImportFile</a></span></dt><dt><span class="section"><a href="#idp51123264">2.20. ImportFile2D</a></span></dt><dt><span class="section"><a href="#idp51133824">2.21. ImportFileCSV</a></span></dt><dt><span class="section"><a href="#idp51136896">2.22. ImportFileHDF5</a></span></dt><dt><span class="section"><a href="#idp51145584">2.23. ImportFilePlugin</a></span></dt><dt><span class="section"><a href="#idp51148416">2.24. ImportFITSFile</a></span></dt><dt><span class="section"><a href="#idp51153696">2.25. ImportString</a></span></dt><dt><span class="section"><a href="#idp51158928">2.26. ImportString2D</a></span></dt><dt><span class="section"><a href="#idp51162896">2.27. IsClosed</a></span></dt><dt><span class="section"><a href="#idp51165872">2.28. List</a></span></dt><dt><span class="section"><a href="#idp51168416">2.29. Load</a></span></dt><dt><span class="section"><a href="#idp51172096">2.30. MoveToPage</a></span></dt><dt><span class="section"><a href="#idp51175056">2.31. ReloadData</a></span></dt><dt><span class="section"><a href="#idp51177968">2.32. Rename</a></span></dt><dt><span class="section"><a href="#idp51181200">2.33. Remove</a></span></dt><dt><span class="section"><a href="#idp51184224">2.34. ResizeWindow</a></span></dt><dt><span class="section"><a href="#idp51187104">2.35. Save</a></span></dt><dt><span class="section"><a href="#idp51189504">2.36. Set</a></span></dt><dt><span class="section"><a href="#idp51194432">2.37. SetAntiAliasing</a></span></dt><dt><span class="section"><a href="#idp51196928">2.38. SetData</a></span></dt><dt><span class="section"><a href="#idp51199712">2.39. SetDataExpression</a></span></dt><dt><span class="section"><a href="#idp51204048">2.40. SetDataRange</a></span></dt><dt><span class="section"><a href="#idp51207296">2.41. SetData2D</a></span></dt><dt><span class="section"><a href="#idp51210768">2.42. SetData2DExpression</a></span></dt><dt><span class="section"><a href="#idp51213408">2.43. SetData2DExpressionXYZ</a></span></dt><dt><span class="section"><a href="#idp51216288">2.44. SetData2DXYFunc</a></span></dt><dt><span class="section"><a href="#idp51219088">2.45. SetDataDateTime</a></span></dt><dt><span class="section"><a href="#idp51221584">2.46. SetDataText</a></span></dt><dt><span class="section"><a href="#idp51225776">2.47. SetToReference</a></span></dt><dt><span class="section"><a href="#idp51228176">2.48. SetUpdateInterval</a></span></dt><dt><span class="section"><a href="#idp51231472">2.49. SetVerbose</a></span></dt><dt><span class="section"><a href="#idp51235120">2.50. StartSecondView</a></span></dt><dt><span class="section"><a href="#idp51238288">2.51. TagDatasets</a></span></dt><dt><span class="section"><a href="#idp51240688">2.52. To</a></span></dt><dt><span class="section"><a href="#idp51243456">2.53. Quit</a></span></dt><dt><span class="section"><a href="#idp51245856">2.54. WaitForClose</a></span></dt><dt><span class="section"><a href="#idp51248720">2.55. Zoom</a></span></dt></dl></dd><dt><span class="section"><a href="#idp51251888">3. Security</a></span></dt></dl></dd><dt><span class="chapter"><a href="#idp51254992">4. Using Veusz from other programs</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51255632">1. Non-Qt Python programs</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51257872">1.1. Older path-based interface</a></span></dt><dt><span class="section"><a href="#idp51279488">1.2. New-style object interface</a></span></dt><dt><span class="section"><a href="#idp51299440">1.3. Translating old to new style</a></span></dt></dl></dd><dt><span class="section"><a href="#idp51303744">2. PyQt4 programs</a></span></dt><dt><span class="section"><a href="#idp51305008">3. Non Python programs</a></span></dt><dt><span class="section"><a href="#idp51316400">4. C, C++ and Fortran</a></span></dt></dl></dd></dl></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="idp46268816"></a>Chapter 1. Introduction</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="#idp46269456">1. Veusz</a></span></dt><dt><span class="section"><a href="#idp46272768">2. Terminology</a></span></dt><dd><dl><dt><span class="section"><a href="#idp46273824">2.1. Widget</a></span></dt><dt><span class="section"><a href="#idp46183680">2.2. Settings: properties and formatting</a></span></dt><dt><span class="section"><a href="#idp46187600">2.3. Text</a></span></dt><dt><span class="section"><a href="#idp50475040">2.4. Measurements</a></span></dt><dt><span class="section"><a href="#idp48945696">2.5. Axis numeric scales</a></span></dt></dl></dd><dt><span class="section"><a href="#idp50264784">3. Installation</a></span></dt><dt><span class="section"><a href="#idp48946656">4. The main window</a></span></dt><dt><span class="section"><a href="#idp50897936">5. My first plot</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp46269456"></a>1. Veusz</h2></div></div></div><p>Veusz is a scientific plotting package. It was designed to
      be easy to use, easily extensible, but powerful. The program
      features a graphical user interface, which works under
      Unix/Linux, Windows or Mac OS X. It can also be easily scripted
      (the saved file formats are similar to Python scripts) or used
      as module inside Python. Veusz reads data from a number of
      different types of data file, it can be manually entered, or
      constructed from other datasets.</p><p>In Veusz the document is built in an object-oriented
      fashion, where a document is built up by a number of widgets in
      a hierarchy. For example, multiple function or xy widgets can be
      placed inside a graph widget, and many graphs can be placed in a
      grid widget.</p><p>The technologies behind Veusz include PyQt (a very easy to
      use Python interface to Qt, which is used for rendering and the
      graphical user interface, GUI) and numpy (a package for Python
      which makes the handling of large datasets easy). Veusz can be
      extended by the user easily by adding plugins. Support for
      different data file types can be added with import
      plugins. Dataset plugins automate the manipulation of
      datasets. Tools plugins automate the manipulation of the
      document.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp46272768"></a>2. Terminology</h2></div></div></div><p>Here we define some terminology for future use.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp46273824"></a>2.1. Widget</h3></div></div></div><p>A document and its graphs are built up from widgets.
	These widgets can often by placed within each other, depending
	on the type of the widget. A widget has children (those
	widgets placed within it) and its parent. The widgets have a
	number of different settings which modify their
	behaviour. These settings are divided into properties, which
	affect what is plotted and how it is plotted. These would
	include the dataset being plotted or whether an axis is
	logarithmic.  There are also formatting settings, including
	the font to be used and the line thickness. In addition they
	have actions, which perform some sort of activity on the
	widget or its children, like "fit" for a fit widget.</p><p>As an aside, using the scripting interface, widgets are
	specified with a "path", like a file in Unix or Windows. These
	can be relative to the current widget (do not start with a
	slash), or absolute (do not start with a slash). Examples of
	paths include, "/page1/graph1/x", "x" and ".".</p><p>The widget types include</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><span class="command"><strong>document</strong></span> - representing a
	      complete document. A document can contain pages. In
	      addition it contains a setting giving the page size for
	      the document.</p></li><li class="listitem"><p><span class="command"><strong>page</strong></span> - representing a page in a
	      document. One or more graphs can be placed on a page, or
	      a grid.</p></li><li class="listitem"><p><span class="command"><strong>graph</strong></span> - defining an actual
	      graph. A graph can be placed on a page or within a
	      grid. Contained within the graph are its axes and
	      plotters. A graph can be given a background fill and a
	      border if required. It also has a margin, which
	      specifies how far away from the edge of its parent widget
	      to plot the body of the graph.</p><p>A graph can contain several axes, at any position
	      on the plot. In addition a graph can use axes defined in
	      parent widgets, shared with other graphs.</p><p>More than one graph can be placed within in a
	      page. The margins can be adjusted so that they lie
	      within or besides each other.</p></li><li class="listitem"><p><span class="command"><strong>grid</strong></span> - containing one or more
	    graphs. A grid plots graphs in a gridlike fashion. You can
	    specify the number of rows and columns, and the plots are
	    automatically replotted in the chosen arrangement. A grid
	    can contain graphs or axes. If an axis is placed in a
	    grid, it can be shared by the graphs in the grid.</p></li><li class="listitem"><p><span class="command"><strong>axis</strong></span> - giving the scale for
	    plotting data. An axis translates the coordinates of the
	    data to the screen. An axis can be linear or logarithmic,
	    it can have fixed endpoints, or can automatically get them
	    from the plotted data. It also has settings for the axis
	    labels and lines, tick labels, and major and minor tick
	    marks.</p><p>An axis may be "horizontal" or "vertical" and can
	    appear anywhere on its parent graph or grid.</p><p>If an axis appears within a grid, then it can be
	    shared by all the graphs which are contained within the
	    grid.</p><p> The <span class="command"><strong>axis-broken</strong></span> widget is an
	    axis sub-type. It is an axis type where there are
	    jumps in the scale of the axis.</p><p>The <span class="command"><strong>axis-function</strong></span> widget allows
	    the user to create an axis where the values are scaled by
	    a monotonic function, allowing non-linear and
	    non-logarithmic axis scales. The widget can also be linked
	    to a different axis via the function.</p></li><li class="listitem"><p>plotters - types of widgets which plot data or add
	      other things on a graph. There is no actual plotter
	      widget which can be added, but several types of plotters
	      listed below. Plotters typically take an axis as a
	      setting, which is the axis used to plot the data on the
	      graph (default x and y).</p><div class="orderedlist"><ol class="orderedlist" type="a"><li class="listitem"><p><span class="command"><strong>function</strong></span> - a plotter which
		  plots a function on the graph. Functions can be
		  functions of x or y (parametric functions are not
		  done yet!), and are defined in Python expression
		  syntax, which is very close to most other
		  languages. For example "3*x**2 + 2*x - 4". A number
		  of functions are available (e.g. sin, cos, tan, exp,
		  log...). Technically, Veusz imports the numpy
		  package when evaluating, so numpy functions are
		  available.</p><p>As well as the function setting, also settable
		  is the line type to plot the function, and the
		  number of steps to evaluate the function when
		  plotting. Filling is supported
		  above/below/left/right of the function.</p></li><li class="listitem"><p><span class="command"><strong>xy</strong></span> - a plotter which plots
		  scatter, line, or stepped plots. This versatile
		  plotter takes an x and y dataset, and plots
		  (optional) points, in a chosen marker and colour,
		  connecting them with (optional) lines, and plotting
		  (optional) error bars. An xy plotter can also plot a
		  stepped line, allowing histograms to be plotted
		  (note that it doesn't yet do the binning of the
		  data).</p><p>The settings for the xy widget are the various
		  attibutes for the points, line and error bars, the
		  datasets to plot, and the axes to plot on.</p><p>The xy plotter can plot a label next to each
		dataset, which is either the same for each point or
		taken from a text dataset.</p><p>If you wish to leave gaps in a plot, the input
		value "nan" can be specified in the numeric
		dataset.</p></li><li class="listitem"><p><span class="command"><strong>fit</strong></span> - fit a function to
		  data. This plotter is a like the function plotter,
		  but allows fitting of the function to data. This is
		  achived by clicking on a "fit" button, or using the
		  "fit" action of the widget. The fitter takes a
		  function to fit containing the unknowns,
		  e.g. "a*x**2 + b*x + c", and initial values for the
		  variables (here a, b and c). It then fits the data
		  (note that at the moment, the fit plotter fits all
		  the data, not just the data that can be seen on the
		  graph) by minimising the chi-squared.</p><p>In order to fit properly, the y data (or x, if
		  fitting as a function of x) must have a properly
		  defined, preferably symmetric error. If there is
		  none, Veusz assumes the same fractional error
		  everywhere, or symmetrises asymmetric errors.</p><p>Note that more work is required in this
		  widget, as if a parameter is not well defined by the
		  data, the matrix inversion in the fit will fail. In
		  addition Veusz does not supply estimates for the
		  errors or the final chi-squared in a machine
		  readable way.</p><p>If the fitting parameters vary significantly
		from 1, then it is worth "normalizing" them by adding
		in a factor in the fit equation to bring them to of
		the order of 1.</p></li><li class="listitem"><p><span class="command"><strong>bar</strong></span> - a bar chart which plots
		sets of data as horizontal or vertical bars. Multiple
		datasets are supported. In "grouped" mode the bars are
		placed side-by-side for each dataset. In "stacked"
		mode the bars are placed on top of each other (in the
		appropriate direction according to the sign of the
		dataset). Bars are placed on coordinates given, or in
		integer values from 1 upward if none are given. Error
		bars are plotted for each of the datasets.</p><p>Different fill styles can be given for each
		dataset given. A separate key value can be given for
		each dataset.</p></li><li class="listitem"><p><span class="command"><strong>key</strong></span> - a box which describes
		  the data plotted. If a key is added to a plot, the
		  key looks for "key" settings of the other data
		  plotted within a graph. If there any it builds up a
		  box containing the symbol and line for the plotter,
		  and the text in the "key" setting of the widget. This
		  allows a key to be very easily added to a
		  plot.</p><p>The key may be placed in any of the corners of
		  the plot, in the centre, or manually
		  placed. Depending on the ordering of the widgets,
		  the key will be placed behind or on top of the
		  widget. The key can be filled and surrounded by a
		  box, or not filled or surrounded.</p></li><li class="listitem"><p><span class="command"><strong>label</strong></span> - a text label places
		on a graph. The alignment can be adjusted and the font
		changed. The position of the label can be specified in
		fractional terms of the current graph, or using axis
		coordinates.</p></li><li class="listitem"><p><span class="command"><strong>rect, ellipse</strong></span> - these draw a
		rectangle or ellipse, respectively, of size and
		rotation given. These widgets can be placed directly
		on the page or on a graph. The centre can be given in
		axis coordinates or fractional coordinates. </p></li><li class="listitem"><p><span class="command"><strong>imagefile</strong></span> - draw an external
		graphs file on the graph or page, with size and
		rotation given. The centre can be given in axis
		coordinates or fractional coordinates.</p></li><li class="listitem"><p><span class="command"><strong>line</strong></span> - draw a line with
		optional arrowheads on the graph or page. One end can
		be given in axis coordinates or fractional
		coordinates.</p></li><li class="listitem"><p><span class="command"><strong>contour</strong></span> - plot contours of a
		2D dataset on the graph. Contours are automatically
		calculated between the minimum and maximum values of
		the graph or chosen manually. The line style of the
		contours can be chosen individually and the region
		between contours can be filled with shading or
		color.</p><p>2D datasets currently consist of a regular grid
		of values between minimum and maximum positions in x
		and y. They can be constructed from three 1D datasets
		of x, y and z if they form a regular x, y grid.</p></li><li class="listitem"><p><span class="command"><strong>image</strong></span> - plot a 2D dataset as
		a colored image. Different color schemes can be
		chosen. The scaling between the values and the image
		can be specified as linear, logarithmic, square-root
		or square.
		</p></li><li class="listitem"><p><span class="command"><strong>polygon</strong></span> - plot x and y points
		from datasets as a polygon. The polygon can be placed
		directly on the page or within a graph. Coordinates
		are either plotted using the axis or as fractions of
		the width and height of the containing widget.
		</p></li><li class="listitem"><p><span class="command"><strong>boxplot</strong></span> - plot distribution
		of points in a dataset.</p></li><li class="listitem"><p><span class="command"><strong>polar</strong></span> - plot polar data or
		functions. This is a non-orthogonal plot and is placed
		directly on the page rather than in a graph.</p></li><li class="listitem"><p><span class="command"><strong>ternary</strong></span> - plot data of three
		variables which add up to 100 per cent.This is a
		non-orthogonal plot and is placed directly on the page
		rather than in a graph.</p></li></ol></div></li></ol></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp46183680"></a>2.2. Settings: properties and formatting</h3></div></div></div><p>The various settings of the widgets come in a number of
	types, including integers (e.g. 10), floats (e.g. 3.14),
	dataset names ("mydata"), expressions ("x+y"), text ("hi
	there!"), distances (see above), options ("horizontal" or
	"vertical" for axes).</p><p>Veusz performs type checks on these parameters. If they
	are in the wrong format the control to edit the setting will
	turn red. In the command line, a TypeError exception is
	thrown.</p><p>In the GUI, the current page is replotted if a setting
	is changed when enter is pressed or the user moves to another
	setting.</p><p>The settings are split up into formatting settings,
	controlling the appearance of the plot, or properties,
	controlling what is plotted and how it is plotted.</p><p>Default settings, including the default font and line
	style, and the default settings for any graph widget, can be
	modified in the "Default styles" dialog box under the "Edit"
	menu. Default settings are set on a per-document basis, but
	can be saved into a separate file and loaded. A default
	default settings file can be given to use for new documents
	(set in the preferences dialog).</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp46187600"></a>2.3. <a name="TextFonts"></a>Text</h3></div></div></div><p>Veusz understands a limited set of LaTeX-like formatting
	for text. There are some differences (for example, "10^23"
	puts the 2 and 3 into superscript), but it is fairly
	similar. You should also leave out the dollar signs. Veusz
	supports superscripts ("^"), subscripts ("_"), brackets for
	grouping attributes are "{" and "}".</p><p>Supported LaTeX symbols include: \AA, \Alpha, \Beta,
 \Chi, \Delta, \Epsilon, \Eta, \Gamma, \Iota, \Kappa, \Lambda, \Mu,
 \Nu, \Omega, \Omicron, \Phi, \Pi, \Psi, \Rho, \Sigma, \Tau, \Theta,
 \Upsilon, \Xi, \Zeta, \alpha, \approx, \ast, \asymp, \beta, \bowtie,
 \bullet, \cap, \chi, \circ, \cup, \dagger, \dashv, \ddagger, \deg,
 \delta, \diamond, \divide, \doteq, \downarrow, \epsilon, \equiv,
 \eta, \gamma, \ge, \gg, \in, \infty, \int, \iota, \kappa, \lambda,
 \le, \leftarrow, \lhd, \ll, \models, \mp, \mu, \neq, \ni, \nu, \odot,
 \omega, \omicron, \ominus, \oplus, \oslash, \otimes, \parallel,
 \perp, \phi, \pi, \pm, \prec, \preceq, \propto, \psi, \rhd, \rho,
 \rightarrow, \sigma, \sim, \simeq, \sqrt, \sqsubset, \sqsubseteq,
 \sqsupset, \sqsupseteq, \star, \stigma, \subset, \subseteq, \succ,
 \succeq, \supset, \supseteq, \tau, \theta, \times, \umid, \unlhd,
 \unrhd, \uparrow, \uplus, \upsilon, \vdash, \vee, \wedge, \xi, \zeta.
 Please request additional characters if they are required (and exist
 in the unicode character set). Special symbols can be included
 directly from a character map.</p><p>Other LaTeX commands are supported. "\\" breaks a
	 line. This can be used for simple tables. For example "{a\\b}
	 {c\\d}" shows "a c" over "b d". The command "\frac{a}{b}"
	 shows a vertical fraction a/b.</p><p>Also supported are commands to change font. The command
	"\font{name}{text}" changes the font text is written in to
	name. This may be useful if a symbol is missing from the
	current font, e.g. "\font{symbol}{g}" should produce a
	gamma. You can increase, decrease, or set the size of the font
	with "\size{+2}{text}", "\size{-2}{text}", or
	"\size{20}{text}". Numbers are in points.</p><p>Various font attributes can be changed: for example,
	"\italic{some italic text}" (or use "\textit" or "\emph"),
	"\bold{some bold text}" (or use "\textbf") and "\underline{some
	underlined text}".</p><p>Example text could include "Area / \pi (10^{-23}
	cm^{-2})", or "\pi\bold{g}".</p><p>Veusz plots these symbols with Qt's unicode support. You
	can also include special characters directly, by copying and
	pasting from a character map application. If your current font
	does not contain these symbols then you may get a box
	character.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp50475040"></a>2.4. Measurements</h3></div></div></div><p>Distances, widths and lengths in Veusz can be specified
	in a number of different ways. These include absolute
	distances specified in physical units, e.g. 1cm, 0.05m, 10mm,
	5in and 10pt, and relative units, which are relative to
	the largest dimension of the page, including 5%, 1/20,
	0.05.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp48945696"></a>2.5. Axis numeric scales</h3></div></div></div><p>The way in which numbers are formatted in axis scales is
	chosen automatically. For standard numerical axes, values are
	shown with the "%Vg" formatting (see below). For date axes, an
	appropriate date formatting is used so that the interval shown
	is correct. A format can be given for an axis in the axis
	number formatting panel can be given to explicitly choose a
	format. Some examples are given in the drop down axis
	menu. Hold the mouse over the example for detail.</p><p>C-style number formatting is used with a few Veusz
	specific extensions. Text can be mixed with format specifiers,
	which start with a "%" sign. Examples of C-style formatting
	include: "%.2f" (decimal number with two decimal places,
	e.g. 2.01), "%.3e" (scientific formatting with three decimal
	places, e.g. 2.123e-02), "%g" (general formatting, switching
	between "%f" and "%e" as appropriate). See <a class="ulink" href="http://opengroup.org/onlinepubs/007908799/xsh/fprintf.html" target="_top">http://opengroup.org/onlinepubs/007908799/xsh/fprintf.html</a> for details.</p><p>Veusz extensions include "%Ve", which is like "%e"
	except it displays scientific notation as written,
	e.g. 1.2x10^23, rather than 1.2e+23. "%Vg" switches between
	standard numbers and Veusz scientific notation for large and
	small numbers. "%VE" using engineering SI suffixes to
	represent large or small numbers (e.g. 1000 is 1k).</p><p>Veusz allows dates and times to be formatted using
	"%VDX" where "X" is one of the formatting characters for
	strftime (see
	<a class="ulink" href="http://opengroup.org/onlinepubs/007908799/xsh/strftime.html" target="_top">http://opengroup.org/onlinepubs/007908799/xsh/strftime.html</a> for details). These include "a" for an abbreviated weekday
	name, "A" for full weekday name, "b" for abbreviated month
	name, "B" for full month name, "c" date and time
	representaiton, "d" day of month 01..31, "H" hour as 00..23,
	"I" hour as 01..12, "j" as day of year 001..366, "m" as month
	01..12, "M" minute as 00..59, "p" AM/PM, "S" second 00..61,
	"U" week number of year 00..53 (Sunday as first day of week),
	"w" weekday as decimal number 0..6, "W" week number of year
	(Monday as first day of week), "x" date representation, "X"
	time representation, "y" year without century 00..99 and "Y"
	year. "%VDVS" is a special Veusz addon format which shows
	seconds and fractions of seconds (e.g. 12.2).</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50264784"></a>3. Installation</h2></div></div></div><p>Please look at the Installation notes (INSTALL) for
      details on installing Veusz.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp48946656"></a>4. The main window</h2></div></div></div><p>You should see the main window when you run Veusz (you can
      just type the veusz command in Unix).</p><div class="mediaobject"><img src="manimages/mainwindow.png"></div><p>The Veusz window is split into several sections. At the
      top is the menu bar and tool bar. These work in the usual way to
      other applications. Sometimes options are disabled (greyed out)
      if they do not make sense to be used. If you hold your mouse
      over a button for a few seconds, you will usually get an
      explanation for what it does called a "tool tip".</p><p>Below the main toolbar is a second toolbar for
      constructing the graph by adding widgets (on the left), and some
      editing buttons. The add widget buttons add the request widget to
      the currently selected widget in the selection window. The widgets
      are arranged in a tree-like structure.</p><p>Below these toolbars and to the right is the plot
      window. This is where the current page of the current document
      is shown. You can adjust the size of the plot on the screen (the
      zoom factor) using the "View" menu or the zoom tool bar button
      (the magnifying glass). Initially you will not see a plot in the
      plot window, but you will see the Veusz logo. At the moment you
      cannot do much else with the window. In the future you will be
      able to click on items in the plot to modify them.</p><p>To the left of the plot window is the selection window,
      and the properties and formatting windows. The properties window
      lets you edit various aspects of the selected widget (such as the
      minimum and maximum values on an axis). Changing these values
      should update the plot. The formatting lets you modify the
      appearance of the selected widget. There are a series of tabs for
      choosing what aspect to modify.</p><p>The various windows can be "dragged" from the main window
      to "float" by themselves on the screen.</p><p>To the bottom of the window is the console. This window is
      not shown by default, but can be enabled in the View menu. The
      console is a Veusz and Python command line console. To read
      about the commands available
      see <a class="link" href="#Commands">Commands</a>. As this is a
      Python console, you can enter mathematical expressions
      (e.g. "1+2.0*cos(pi/4)") here and they will be evaluated when
      you press Enter. The usual special functions and the operators
      are supported. You can also assign results to variables
      (e.g. "a=1+2") for use later. The console also supports command
      history like many Unix shells. Press the up and down cursor keys
      to browse through the history. Command line completion is not
      available yet!</p><p>There also exists a dataset browsing window, by default to
      the right of the screen. This window allows you to view the
      datasets currently loaded, their dimensions and type. Hovering a
      mouse over the size of the dataset will give you a preview of
      the data.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50897936"></a>5. My first plot</h2></div></div></div><p>After opening Veusz, on the left of the main window, you
      will see a Document, containing a Page, which contains a Graph
      with its axes. The Graph is selected in the selection
      window. The toolbar above adds a new widget to the selected
      widget. If a widget cannot be added to a selected widget it is
      disabled. On opening a new document Veusz automatically adds a
      new Page and Graph (with axes) to the document.
</p><p>You will see something like this:</p><div class="mediaobject"><img src="manimages/winwithgraph.png"></div><p>Select the x axis which has been added to the document
      (click on "x" in the selection window). In the properties window
      you will see a variety of different properties you can
      modify. For instance you can enter a label for the axis by
      writing "Area (cm^{2})" in the box next to label and pressing
      enter. Veusz supports text in LaTeX-like form (without the
      dollar signs). Other important parameters is the "log" switch
      which switches between linear and logarithmic axes, and "min"
      and "max" which allow the user to specify the minimum and
      maximum values on the axes.</p><p>The formatting dialog lets you edit various aspects of the
      graph appearance. For instance the "Line" tab allows you to edit
      the line of the axis. Click on "Line", then you can then modify
      its colour. Enter "green" instead of "black" and press
      enter. Try making the axis label bold.</p><p>Now you can try plotting a function on the graph. If the
      graph, or its children are selected, you will then be able to
      click the "function" button at the top (a red curve on a
      graph). You will see a straight line (y=x) added to the plot. If
      you select "function1", you will be able to edit the functional
      form plotted and the style of its line. Change the function to
      "x**2" (x-squared).</p><p>We will now try plotting data on the graph. Go to your
      favourite text editor and save the following data as
      test.dat:</p><div class="informalexample"><pre class="programlisting">
1     0.1   -0.12   1.1    0.1
2.05  0.12  -0.14   4.08   0.12
2.98  0.08  -0.1    2.9    0.11
4.02  0.04  -0.1    15.3   1.0
</pre></div><p>The first three columns are the x data to plot plus its
      asymmetric errors. The final two columns are the y data plus its
      symmetric errors. In Veusz, go to the "Data" menu and select
      "Import". Type the filename into the filename box, or use the
      "Browse..." button to search for the file. You will see a
      preview of the data pop up in the box below. Enter "x,+,- y,+-"
      into the descriptors edit box (note that commas and spaces in
      the descriptor are almost interchangeable in Veusz 1.6 or
      newer). This describes the format of the data which describes
      dataset "x" plus its asymmetric errors, and "y" with its
      symmetric errors. If you now click "Import", you will see it has
      imported datasets "x" and "y".</p><p>To plot the data you should now click on "graph1" in the
      tree window. You are now able to click on the "xy" button (which
      looks like points plotted on a graph). You will see your data
      plotted on the graph. Veusz plots datasets "x" and "y" by
      default, but you can change these in the properties of the "xy"
      plotter.</p><p>You are able to choose from a variety of markers to
      plot. You can remove the plot line by choosing the "Plot Line"
      subsetting, and clicking on the "hide" option. You can change
      the colour of the marker by going to the "Marker Fill"
      subsetting, and entering a new colour (e.g. red), into the
      colour property.</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="idp50908784"></a>Chapter 2. Reading data</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="#idp50917456">1. Standard text import</a></span></dt><dd><dl><dt><span class="section"><a href="#idp50922480">1.1. Data types in text import</a></span></dt><dt><span class="section"><a href="#idp50927472">1.2. Descriptors</a></span></dt></dl></dd><dt><span class="section"><a href="#idp50946592">2. CSV files</a></span></dt><dt><span class="section"><a href="#idp50950432">3. HDF5 files</a></span></dt><dd><dl><dt><span class="section"><a href="#idp50954816">3.1. Error bars</a></span></dt><dt><span class="section"><a href="#idp50956944">3.2. Slices</a></span></dt><dt><span class="section"><a href="#idp50962112">3.3. 2D data ranges</a></span></dt><dt><span class="section"><a href="#idp50964080">3.4. Dates</a></span></dt></dl></dd><dt><span class="section"><a href="#idp50969392">4. 2D text or CSV format</a></span></dt><dt><span class="section"><a href="#idp50990560">5. FITS files</a></span></dt><dt><span class="section"><a href="#idp50996512">6. Reading other data formats</a></span></dt><dt><span class="section"><a href="#idp51003472">7. Manipulating datasets</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51005008">7.1. Using dataset plugins</a></span></dt><dt><span class="section"><a href="#idp51006928">7.2. Using expressions to create new datasets</a></span></dt><dt><span class="section"><a href="#idp51018208">7.3. Linking datasets to expressions</a></span></dt><dt><span class="section"><a href="#idp51019552">7.4. Splitting data</a></span></dt><dt><span class="section"><a href="#idp51022320">7.5. Defining new constants or functions</a></span></dt><dt><span class="section"><a href="#idp51025744">7.6. Dataset plugins</a></span></dt></dl></dd><dt><span class="section"><a href="#idp51027808">8. Capturing data</a></span></dt></dl></div><p>
      Currently Veusz supports reading data from files with text, CSV,
      HDF5, FITS, 2D text or CSV, QDP, binary and NPY/NPZ formats. Use
      the
      <span class="guimenu">Data</span> &#8594; <span class="guimenuitem">Import</span>
      dialog to read data, or the importing commands in the API can be
      used.  In addition, the user can load or write import plugins in
      Python which load data into Veusz in an arbitrary format. At the
      moment QDP, binary and NPY/NPZ files are supported with this
      method. The HDF5 file format is the most sophisticated, and is
      recommended for complex datasets.
    </p><p>
      By default, data are "linked" to the file imported from. This
      means that the data are not stored in the Veusz saved file and
      are reloaded from the original data file when opening. In
      addition, the user can use the
      <span class="guimenu">Data</span> &#8594; <span class="guimenuitem">Reload</span>
      menu option to reload data from linked files. Unselect the
      linked option when importing to remove the association with the
      data file and to store the data in the Veusz saved document.
    </p><p>
      Note that a <span class="symbol">prefix</span> and
      <span class="symbol">suffix</span> can be given when importing. These are
      added to the front or back of each dataset name imported. They
      are convenient for grouping data together.
    </p><div class="mediaobject"><img src="manimages/importdialog.png"></div><p>We list the various types of import below.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50917456"></a>1. Standard text import</h2></div></div></div><p>
	The default text import operates on simple text files. The
	data are assumed to be in columns separated by
	whitespace. Each column corresponds to dataset (or its error
	bars). Each row is an entry in the dataset.
      </p><p>
	The way the data are read is goverened by a simple
	"descriptor". This can simply be a list of dataset names
	separated by spaces. If no descriptor is given, the columns
	are treated as separate datasets and are given names
	<span class="symbol">col1</span>, <span class="symbol">col2</span>, etc. Veusz
	attempts to automatically determine the type of the data.
      </p><p>
	When reading in data, Veusz treats any whitespace as
	separating columns. The columns do not actually need to be
	aligned. Furthermore a "\" symbol can be placed at the end of
	a line to mark a continuation. Veusz will read the next line
	as if it were placed at the end of the current line. In
	addition comments and blank lines are ignored (unless in block
	mode). Comments start with a "#", ";", "!" or "%", and
	continue until the end of the line. The special value "nan"
	can be used to specify a break in a dataset.
      </p><p>
	If the option to read data in blocks is enabled, Veusz treats
	blank lines (or lines starting with the word "no") as block
	separators. For each dataset in the descriptor, separate
	datasets are created for each block, using a numeric suffix
	giving the block number, e.g. <span class="symbol">_1</span>,
	<span class="symbol">_2</span>.
      </p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp50922480"></a>1.1. Data types in text import</h3></div></div></div><p>
	  Veusz supports reading in several types of data. The type of
	  data can be added in round brackets after the name in the
	  descriptor. Veusz will try to guess the type of data based
	  on the first value, so you should specify it if there is any
	  form of ambiguity (e.g. is 3 text or a number). Supported
	  types are numbers (use numeric in brackets) and text (use
	  text in brackets). An example descriptor would be
	  "x(numeric) +- y(numeric) + - label(text)" for an x dataset
	  followed by its symmetric errors, a y dataset followed by
	  two columns of asymmetric errors, and a final column of text
	  for the label dataset.
	</p><p>
	  A text column does not need quotation unless it contains
	  space characters or escape characters. However make sure you
	  deselect the "ignore text" option in the import dialog. This
	  ignores lines of text to ease the import of data from other
	  applications.  Quotation marks are recommended around text
	  if you wish to avoid ambiguity. Text is quoted according to
	  the Python rules for text. Double or single quotation marks
	  can be used, e.g. "A 'test'", 'A second "test"'. Quotes can
	  be escaped by prefixing them with a backslash, e.g. "A new
	  \"test\"". If the data are generated from a Python script,
	  the repr function provides the text in a suitable form.
	</p><p>
	  Dates and times are also supported with the syntax
	  "dataset(date)". Dates must be in ISO format
	  YYYY-MM-DD. Times are in 24 hour format hh:mm:ss.ss. Dates
	  with times are written YYYY-MM-DDThh:mm:ss.ss (this is a
	  standard ISO format, see <a class="ulink" href="http://www.w3.org/TR/NOTE-datetime" target="_top">http://www.w3.org/TR/NOTE-datetime</a>). Dates are
	  stored within Veusz as a number which is the number of
	  seconds since the start of January 1st 2009. Veusz also
	  supports dates and times in the local format, though take
	  note that the same file and data may not work on a system in
	  a different location.
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp50927472"></a>1.2. Descriptors</h3></div></div></div><a name="Descriptors"></a><p>
	  A list of datasets, or a "Descriptor", is given in the
	  Import dialog to describe how the data are formatted in the
	  import file. The descriptor at its simplest is a space or
	  comma-separated list of the names of the datasets to import.
	  These are columns in the file.
	</p><p>
	  Following a dataset name the text "+", "-", or "+-" can be
	  given to say that the following column is a positive error
	  bar, negative error bar or symmetric error bar for the
	  previous (non error bar) dataset. These symbols should be
	  separated from the dataset name or previous symbol with a
	  space or a comma symbol.
	</p><p>
	  In addition, if multiple numbered columns should be
	  imported, the dataset name can be followed by square
	  brackets containing a range in the form "[a:b]" to number
	  columns a to b, or [:] to number remaining columns. See
	  below for examples of this use.
	</p><p>
	  Dataset names can contain virtually any character, even
	  unicode characters. If the name contains non alpha-numeric
	  characters (characters outside of A-Z, a-z and 0-9), then
	  the dataset name should be contained within back-tick
	  characters. An example descriptor is <span class="command"><strong>`length data
	  (m)`,+- `speed (mps)`,+,-</strong></span>, for two datasets with
	  spaces and brackets in their names.
	</p><p>
	  Instead of specifying the descriptor in the Import dialog,
	  the descriptor can be placed in the data file using a
	  descriptor statement on a separate line, consisting of
	  "descriptor" followed by the descriptor. Multiple
	  descriptors can be placed in a single file, for example:
	</p><div class="informalexample"><pre class="programlisting">
# here is one section
descriptor x,+- y,+,-
1 0.5  2 0.1 -0.1
2 0.3  4 0.2 -0.1

# my next block
descriptor alpha beta gamma
1 2 3
4 5 6
7 8 9

# etc...
</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="idp50933888"></a>1.2.1. Descriptor examples</h4></div></div></div><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
	       <span class="command"><strong>x y</strong></span> two columns are present in the
	       file, they will be read in as datasets "x" and "y".
	     </p></li><li class="listitem"><p>
	       <span class="command"><strong>x,+- y,+,-</strong></span> or <span class="command"><strong>x +- y +
	       -</strong></span> two datasets are in the file. Dataset "x"
	       consists of the first two columns. The first column are
	       the values and the second are the symmetric errors. "y"
	       consists of three columns (note the comma between + and
	       -). The first column are the values, the second
	       positive asymmetric errors, and the third negative
	       asymmetric errors.
	     </p><p>
	    Suppose the input file contains:
	  </p><div class="informalexample"><pre class="programlisting">
1.0  0.3  2   0.1  -0.2
1.5  0.2  2.3 2e-2 -0.3E0
2.19 0.02 5    0.1 -0.1
</pre></div><p>
	    Then x will contain "1+-0.3", "1.5+-0.2",
	    "2.19+-0.02". y will contain "2 +0.1 -0.2", "2.3 +0.02
	    -0.3", "5 +0.1 -0.1".
	  </p></li><li class="listitem"><p>
	    <span class="command"><strong>x[1:2] y[:]</strong></span> the first column is the
	    data "x_1", the second "x_2". Subsequent columns are read
	    as "y[1]" to "y[n]".
	  </p></li><li class="listitem"><p>
	    <span class="command"><strong>y[:]+-</strong></span> read each pair of columns as
	    a dataset and its symmetric error, calling them "y[1]" to
	    "y[n]".
	  </p></li><li class="listitem"><p>
	    <span class="command"><strong>foo,,+-</strong></span>  read the first column as
	    the foo dataset, skip a column, and read the third column as
	    its symmetric error.
	  </p></li></ol></div></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50946592"></a>2. CSV files</h2></div></div></div><p>
	CVS (comma separated variable) files are often written from
	other programs, such as spreadsheets, including Excel and
	Gnumeric. Veusz supports reading from these files.
      </p><p>
	In the import dialog choose "CSV", then choose a filename to
	import from. In the CSV file the user should place the data in
	either rows or columns. Veusz will use a name above a column
	or to the left of a row to specify what the dataset name
	should be. The user can use new names further down in columns
	or right in rows to specify a different dataset name. Names do
	not have to be used, and Veusz will assign default "col" and
	"row" names if not given. You can also specify a prefix which
	is prepended to each dataset name read from the file.
      </p><p>
	To specify symmetric errors for a column, put "+-" as the
	dataset name in the next column or row. Asymmetric errors can
	be stated with "+" and "-" in the columns.
      </p><p>
	The data type in CSV files are automatically detected unless
	specified. The data type can be given in brackets after the
	column name, e.g. "name (text)", where the data type is
	"date", "numeric" or "text". Explicit data types are needed if
	the data look like a different data type (e.g. a text item of
	"1.23"). The date format in CSV files can be specified in the
	import dialog box - see the examples given. In addition CSV
	files support numbers in European format (e.g. 2,34 rather
	than 2.34), depending on the setting in the dialog box.
      </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50950432"></a>3. HDF5 files</h2></div></div></div><p>
	HDF5 is a flexible data format. Datasets and tables can be
	stored in a hierarchical arrangements of groups within a
	file. Veusz supports reading 1D numeric, text, date-time or 2D
	numeric data from HDF files. The <span class="command"><strong>h5py</strong></span>
	Python module must be installed to use HDF5 files (included in
	binary releases).
      </p><p>
	In the import dialog box, choose which individual datasets to
	import, or selecting a group to import all the datasets within
	the group. If selecting a group, datasets in the group
	incompatible with Veusz are ignored.
      </p><p>
	A name can be provided for each dataset imported by entering
	one under "Import as". If one is not given, the dataset or
	column name is used. The name can also be specified by setting
	the HDF5 dataset attribute <code class="varname">vsz_name</code> to the
	name. Note that for compound datasets (tables),
	<code class="varname">vsz_</code> attributes for columns are given by
	appending the suffix <code class="varname">_columnname</code> to the
	attribute.
      </p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp50954816"></a>3.1. Error bars</h3></div></div></div><p>
	  Error bars are supported in two ways. The first way is to
	  combine 1D datasets. For the datasets which are error bars,
	  use a name which is the same as the main dataset but with
	  the suffix "(+-)", "(+)" or "(-)", for symmetric, postive or
	  negative error bars, respectively. The second method is to
	  use a 2D dataset with two or three columns, for symmetric or
	  asymmetric error bars, respectively. Click on the dataset in
	  the dialog and choose the option to import as a 1D
	  dataset. This second method can also be enabled by adding an
	  HDF5 attribute <code class="varname">vsz_twod_as_oned</code> set to a
	  non-zero value for the dataset.
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp50956944"></a>3.2. Slices</h3></div></div></div><p>
	  As Veusz only supports 1D and 2D datasets, you may wish to
	  reduce the dimensions of a dataset before importing by
	  slicing. You can also give a slice to import a subset of a
	  dataset. When importing, in the slice column you can give a
	  slice expression. This should have the same number of
	  entries as the dataset has dimensions, separated by
	  commas. An entry can be a single number, to select a
	  particular row or column. Alternatively it could be an
	  expression like <code class="literal">a:b:c</code> or
	  <code class="literal">a:b</code>, where <code class="literal">a</code> is the
	  starting index, <code class="literal">b</code> is one beyond the
	  stopping index and optionally <code class="literal">c</code> is the
	  step size. A slice can also be specified by providing an
	  HDF5 attribute <code class="varname">vsz_slice</code> for the dataset.
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp50962112"></a>3.3. 2D data ranges</h3></div></div></div><p>
	  2D data have an associated X and Y range. By default the
	  number of pixels of the image are used to give this range.
	  A range can be specified by clicking on the dataset and
	  entering a minimum and maximum X and Y
	  coordinates. Alternatively, provide the HDF5 attribute for
	  the dataset <code class="varname">vsz_range</code>, which should be set
	  to an array of four values (minimum x, minimum y, maximum x,
	  maximum y).
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp50964080"></a>3.4. Dates</h3></div></div></div><p>
	  Date/time datasets can be made from a 1D numeric dataset or
	  from a text dataset. For the 1D dataset, use the number of
	  seconds relative to the start of the year 2009 (this is
	  Veusz format) or the year 1970 (this is Unix format). In the
	  import dialog, click on the name of the dataset and choose
	  the date option. To specify a date format in the HDF5 file,
	  set the attribute <code class="varname">vsz_convert_datetime</code> to
	  either <code class="literal">veusz</code> or <code class="literal">unix</code>.
	</p><p>
	  For text datasets, dates must be given in the right format,
	  selected in the import dialog after clicking on the dataset
	  name. As in other file formats, by default Veusz uses ISO
	  8601 format, which looks like "2013-12-22T21:08:07", where
	  the date and time parts are optional. The T is also
	  optional. You can also provide your own format when
	  importing by giving a date expression using YYYY, MM, DD,
	  hh, mm and ss (e.g. "YYYY-MM-DD|T|hh:mm:ss"), where vertical
	  bars mark optional parts of the expression. To automate
	  this, set the attribute
	  <code class="varname">vsz_convert_datetime</code> to the format
	  expression or <code class="literal">iso</code> to specify ISO format.
	</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50969392"></a>4. 2D text or CSV format</h2></div></div></div><p>
	Veusz can import 2D data from standard text or CSV files. In
	this case the data should consist of a matrix of data values,
	with the columns separated by one or more spaces or tabs and
	the rows on different lines.
      </p><p>
      In addition to the data the file can contain lines at the top
      which affect the import. Such specifiers are used, for example,
      to change the coordinates of the pixels in the file. By default
      the first pixels coordinates is between 0 and 1, with the centre
      at 0.5. Subsequent pixels are 1 greater. When using specifiers
      in CSV files, put the different parts (separated by spaces) in
      separate columns. Below are listed the specifiers:
    </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><span class="command"><strong>xrange A B</strong></span> - make the 2D dataset span
	the coordinate range A to B in the x-axis (where A and B are
	numbers). Note that the range is inclusive, so a 1 pixel wide
	image with A=0 and B=1 would have the pixel centre at 0.5. The
	pixels are assumed to have the same spacing. Do not use this
	as the same time as the <span class="command"><strong>xedge</strong></span> or
	<span class="command"><strong>xcent</strong></span> options.</p></li><li class="listitem"><p><span class="command"><strong>yrange A B</strong></span> - make the 2D dataset span
	the coordinate range A to B in the y-axis (where A and B are
	numbers).</p></li><li class="listitem"><p><span class="command"><strong>xedge A B C...</strong></span> - rather than assume
	the pixels have the same spacing, give the coordinates of the
	edges of the pixels in the x-axis. The numbers should be
	space-separated and there should be one more number than
	pixels. Do not give <span class="command"><strong>xrange</strong></span> or
	<span class="command"><strong>xcent</strong></span> if this is given.</p></li><li class="listitem"><p><span class="command"><strong>yedge A B C...</strong></span> - rather than assume
	the pixels have the same spacing, give the coordinates of the
	edges of the pixels in the y-axis.</p></li><li class="listitem"><p><span class="command"><strong>xcent A B C...</strong></span> - rather than give a
	total range or pixel edges, give the centres of the
	pixels. There should be the same number of values as pixels in
	the image. Do not give <span class="command"><strong>xrange</strong></span> or
	<span class="command"><strong>xedge</strong></span> if this is given.</p></li><li class="listitem"><p><span class="command"><strong>ycent A B C...</strong></span> - rather than give a
	total range or pixel edges, give the centres of the
	pixels.</p></li><li class="listitem"><p><span class="command"><strong>invertrows</strong></span> - invert the rows after
	reading the data.</p></li><li class="listitem"><p><span class="command"><strong>invertcols</strong></span> - invert the columns after
	reading the data.</p></li><li class="listitem"><p><span class="command"><strong>transpose</strong></span> - swap rows and columns
	after importing data.</p></li><li class="listitem"><p><span class="command"><strong>gridatedge</strong></span> - the first row and
	leftmost column give the positions of the centres of the
	pixels. This is also an option in the import dialog. The
	values should be increasing.</p></li></ol></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50990560"></a>5. FITS files</h2></div></div></div><p>
	1D or 2D data can be read from FITS files. 1D data, with
	optional errors bars, can be read from table extensions, and
	2D data from image or primary extensions.  Note that pyfits or
	astropy must be installed to get FITS support.
      </p><p>
	To read 1D data, choose a tabular HDU for to import from,
	enter the name to give the imported data, and choose the
	columns to assign to the data. Multiple sets of data can be
	read by repeatedly importing.
      </p><p>
	For 2D data, choose an image HDU. Enter the name of the
	dataset. The data are imported with pixel coordinates by
	default (i.e. the pixels are numbered with integers). Other
	modes can be selected under <span class="guilabel">Image WCS
	mode</span>. These include fractional, where the pixels
	are numbered between 0 and 1. <span class="guilabel">Pixel (WCS)</span>
	assigns the pixel coordinate calculated relative to the
	<code class="varname">CRPIX1/2</code> header keywords. <span class="guilabel">Linear
	(WCS)</span> uses linear coordinates where the Pixel (WCS)
	coordinates are multiplied by the respective
	<code class="varname">CDELT1/2</code> values and added to the
	<code class="varname">CRVAL1/2</code> values.
      </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp50996512"></a>6. Reading other data formats</h2></div></div></div><p>As mentioned above, a user may write some Python code to
      read a data file or set of data files. To write a plugin which
      is incorportated into Veusz, see
      <a class="ulink" href="http://barmag.net/veusz-wiki/ImportPlugins" target="_top">http://barmag.net/veusz-wiki/ImportPlugins</a></p><p>You can also include Python code in an input file to read
      data, which we describe here. Suppose an input file "in.dat"
      contains the following data:</p><div class="informalexample"><pre class="programlisting">
1   2
2   4
3   9
4   16
</pre></div><p>Of course this data could be read using the <a class="link" href="#Command.ImportFile">ImportFile</a>
	command. However, you could also read it with the following
	Veusz script (which could be saved to a file and loaded with
	<span class="command"><strong>execfile</strong></span> or <a class="link" href="#Command.Load">Load</a>. The script also places
	symmetric errors of 0.1 on the x dataset.</p><div class="informalexample"><pre class="programlisting">
x = []
y = []
for line in open("in.dat"):
    parts = [float(i) for i in line.split()]
    x.append(parts[0])
    y.append(parts[1])

SetData('x', x, symerr=0.1)
SetData('y', y)
</pre></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51003472"></a>7. Manipulating datasets</h2></div></div></div><p>Imported datasets can easily be modified in the Data
      Editor dialog box. This dialog box can also be used to create
      new datasets from scratch by typing them in. The Data Create
      dialog box is used to new datasets as a numerical sequence,
      parametrically or based on other datasets given expressions. If
      you want to plot a function of a dataset, you often do not have
      to create a new dataset. Veusz allows to enter expressions
      directly in many places.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51005008"></a>7.1. Using dataset plugins</h3></div></div></div><p>Dataset plugins can be used to perform arbitrary
	manipulation of datasets. Veusz includes several plugins for
	mathematical operation of data and other dataset
	manipulations, such as concatenation or splitting. If you wish
	to write your own plugins look at
	<a class="ulink" href="http://barmag.net/veusz-wiki/DatasetPlugins" target="_top">http://barmag.net/veusz-wiki/DatasetPlugins</a>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51006928"></a>7.2. Using expressions to create new datasets</h3></div></div></div><p>For instance, if the user has already imported dataset d,
      then they can create d2 which consists of d**2. Expressions are
      in Python numpy syntax and can include the usual mathematical
      functions.</p><div class="mediaobject"><img src="manimages/createdataset.png"></div><p>Expressions for error bars can also be given. By appending
      <span class="command"><strong>_data</strong></span>, <span class="command"><strong>_serr</strong></span>,
      <span class="command"><strong>_perr</strong></span> or <span class="command"><strong>_nerr</strong></span> to the name
      of the dataset in the expression, the user can base their
      expression on particular parts of the given dataset (the main
      data, symmetric errors, positive errors or negative
      errors). Otherwise the program uses the same parts as is
      currently being specified.</p><p>If a dataset name contains non alphanumeric characters,
      its name should be quoted in the expression in back-tick
      characters, e.g. <span class="command"><strong>`length (cm)`*2</strong></span>.</p><p>The numpy functionality is particularly useful for doing
      more complicated expressions. For instance, a conditional
      expression can be written as
      <span class="command"><strong>where(x&lt;y,x,y)</strong></span> or
      <span class="command"><strong>where(isfinite(x),a,b))</strong></span>.</p><p>You often do not need to create a new dataset when. For
      example, with the xy point plotter widget, you can directly
      enter an expression as the X and Y dataset settings. When you
      give a direct dataset expression, you can define error bar
      expressions by separating them by commas, and optionally
      surrounding them by brackets. For example
      <span class="command"><strong>(a,0.1)</strong></span> plots dataset a as the data, with
      symmetric errors bars of 0.1. Asymmetric bars are given as
      <span class="command"><strong>(a,a*0.1,-a*0.1)</strong></span>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51018208"></a>7.3. Linking datasets to expressions</h3></div></div></div><p>A particularly useful feature is to be able to link a
      dataset to an expression, so if the expression changes the
      dataset changes with it, like in a spreadsheet.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51019552"></a>7.4. Splitting data</h3></div></div></div><p>Data can also be chopped in this method, for example
      using the expression <span class="command"><strong>x[10:20]</strong></span>, which makes a
      dataset based on the 11th to 20th item in the x dataset (the
      ranges are Python syntax, and are zero-based). Negative indices
      count backwards from the end of the dataset. Data can be skipped
      using expressions such as
	  <span class="command"><strong>data[::2]</strong></span>, which skips every other element</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51022320"></a>7.5. Defining new constants or functions</h3></div></div></div><p>User defined constants or functions can be defined in
	the "Custom definitions" dialog box under the edit
	menu. Functions can also be imported from external python
	modules.</p><div class="mediaobject"><img src="manimages/customdefinition.png"></div><p>Custom definitions are defined on a per-document basis,
	but can be saved or loaded into a file. A default custom
	definitions file can be set in the preferences dialog
	box.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51025744"></a>7.6. Dataset plugins</h3></div></div></div><p>In addition to creating datasets based on expressions, a
	variety of dataset plugins exist, which make certain
	operations on datasets much more convenient. See the Data,
	Operations menu for a list of the default plugins. The user
	can easily create new plugins. See
	<a class="ulink" href="http://barmag.net/veusz-wiki/DatasetPlugins" target="_top">http://barmag.net/veusz-wiki/DatasetPlugins</a> for details.
	</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51027808"></a>8. Capturing data</h2></div></div></div><p>
	In addition to the standard data import, data can be captured
	as it is created from an external program, a network socket or
	a file or named pipe. When capturing from a file, the
	behaviour is like the Unix <span class="command"><strong>tail -f</strong></span> command,
	where new lines written to the file are captured. To use the
	capturing facility, the data must be written in the simple
	line based standard Veusz text format. Data are whitespace
	separated, with one value per dataset given on a single line.
      </p><p>
	To capture data, use the dialog box
	<span class="guimenu">Data</span> &#8594; <span class="guimenuitem">Capture</span>. A
	list of datasets should be given. This is the <a class="link" href="#Descriptors">standard descriptor format</a>.
	Choose the source of the data, which is either a a filename or
	named pipe, a network socket to connect to, or a command line
	for an external program. Capturing ends if the source of the
	data runs out (for external programs or network sockets) or
	the finish button is clicked. It can optionally end after a
	certain number of data lines or when a time period has
	expired. Normally the data are updated in Veusz when the
	capturing is finished. There is an option to update the
	document at intervals, which is useful for monitoring.
	A plot using the variables will update when the data are updated.
      </p><p>
	Click the <code class="literal">Capture</code> button to start the
	capture. Click <code class="literal">Finish</code> or
	<code class="literal">Cancel</code> to stop. Cancelling destroys
	captured data.
      </p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="idp51035584"></a>Chapter 3. Command line interface</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="#idp51036720">1. Introduction</a></span></dt><dt><span class="section"><a href="#idp51044016">2. Commands</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51045040">2.1. Action</a></span></dt><dt><span class="section"><a href="#idp51047648">2.2. Add</a></span></dt><dt><span class="section"><a href="#idp51055552">2.3. AddCustom</a></span></dt><dt><span class="section"><a href="#idp46085808">2.4. AddImportPath</a></span></dt><dt><span class="section"><a href="#idp46088432">2.5. CloneWidget</a></span></dt><dt><span class="section"><a href="#idp46091184">2.6. Close</a></span></dt><dt><span class="section"><a href="#idp51076640">2.7. CreateHistogram</a></span></dt><dt><span class="section"><a href="#idp51079824">2.8. DatasetPlugin</a></span></dt><dt><span class="section"><a href="#idp51082496">2.9. EnableToolbar</a></span></dt><dt><span class="section"><a href="#idp51085040">2.10. Export</a></span></dt><dt><span class="section"><a href="#idp51093872">2.11. ForceUpdate</a></span></dt><dt><span class="section"><a href="#idp51096512">2.12. Get</a></span></dt><dt><span class="section"><a href="#idp51099920">2.13. GetChildren</a></span></dt><dt><span class="section"><a href="#idp51102416">2.14. GetClick</a></span></dt><dt><span class="section"><a href="#idp51105536">2.15. GetData</a></span></dt><dt><span class="section"><a href="#idp51109696">2.16. GetDataType</a></span></dt><dt><span class="section"><a href="#idp51112272">2.17. GetDatasets</a></span></dt><dt><span class="section"><a href="#idp51114752">2.18. GPL</a></span></dt><dt><span class="section"><a href="#idp51117232">2.19. ImportFile</a></span></dt><dt><span class="section"><a href="#idp51123264">2.20. ImportFile2D</a></span></dt><dt><span class="section"><a href="#idp51133824">2.21. ImportFileCSV</a></span></dt><dt><span class="section"><a href="#idp51136896">2.22. ImportFileHDF5</a></span></dt><dt><span class="section"><a href="#idp51145584">2.23. ImportFilePlugin</a></span></dt><dt><span class="section"><a href="#idp51148416">2.24. ImportFITSFile</a></span></dt><dt><span class="section"><a href="#idp51153696">2.25. ImportString</a></span></dt><dt><span class="section"><a href="#idp51158928">2.26. ImportString2D</a></span></dt><dt><span class="section"><a href="#idp51162896">2.27. IsClosed</a></span></dt><dt><span class="section"><a href="#idp51165872">2.28. List</a></span></dt><dt><span class="section"><a href="#idp51168416">2.29. Load</a></span></dt><dt><span class="section"><a href="#idp51172096">2.30. MoveToPage</a></span></dt><dt><span class="section"><a href="#idp51175056">2.31. ReloadData</a></span></dt><dt><span class="section"><a href="#idp51177968">2.32. Rename</a></span></dt><dt><span class="section"><a href="#idp51181200">2.33. Remove</a></span></dt><dt><span class="section"><a href="#idp51184224">2.34. ResizeWindow</a></span></dt><dt><span class="section"><a href="#idp51187104">2.35. Save</a></span></dt><dt><span class="section"><a href="#idp51189504">2.36. Set</a></span></dt><dt><span class="section"><a href="#idp51194432">2.37. SetAntiAliasing</a></span></dt><dt><span class="section"><a href="#idp51196928">2.38. SetData</a></span></dt><dt><span class="section"><a href="#idp51199712">2.39. SetDataExpression</a></span></dt><dt><span class="section"><a href="#idp51204048">2.40. SetDataRange</a></span></dt><dt><span class="section"><a href="#idp51207296">2.41. SetData2D</a></span></dt><dt><span class="section"><a href="#idp51210768">2.42. SetData2DExpression</a></span></dt><dt><span class="section"><a href="#idp51213408">2.43. SetData2DExpressionXYZ</a></span></dt><dt><span class="section"><a href="#idp51216288">2.44. SetData2DXYFunc</a></span></dt><dt><span class="section"><a href="#idp51219088">2.45. SetDataDateTime</a></span></dt><dt><span class="section"><a href="#idp51221584">2.46. SetDataText</a></span></dt><dt><span class="section"><a href="#idp51225776">2.47. SetToReference</a></span></dt><dt><span class="section"><a href="#idp51228176">2.48. SetUpdateInterval</a></span></dt><dt><span class="section"><a href="#idp51231472">2.49. SetVerbose</a></span></dt><dt><span class="section"><a href="#idp51235120">2.50. StartSecondView</a></span></dt><dt><span class="section"><a href="#idp51238288">2.51. TagDatasets</a></span></dt><dt><span class="section"><a href="#idp51240688">2.52. To</a></span></dt><dt><span class="section"><a href="#idp51243456">2.53. Quit</a></span></dt><dt><span class="section"><a href="#idp51245856">2.54. WaitForClose</a></span></dt><dt><span class="section"><a href="#idp51248720">2.55. Zoom</a></span></dt></dl></dd><dt><span class="section"><a href="#idp51251888">3. Security</a></span></dt></dl></div><a name="Commands"></a><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51036720"></a>1. Introduction</h2></div></div></div><p>An alternative way to control Veusz is via its command
      line interface. As Veusz is a a Python application it uses
      Python as its scripting language. Therefore you can freely mix
      Veusz and Python commands on the command line. Veusz can also
      read in Python scripts from files (see the <a class="link" href="#Command.Load">Load</a> command).</p><p>When commands are entered in the command prompt in the
      Veusz window, Veusz supports a simplified command syntax, where
      brackets following commands names, and commas, can replaced by
      spaces in Veusz commands (not Python commands). For example,
      <span class="command"><strong>Add('graph', name='foo')</strong></span>, may be entered as
      <span class="command"><strong>Add 'graph' name='foo'</strong></span>.</p><p>The <span class="command"><strong>numpy</strong></span> package is already
      imported into the command line interface (as "*"), so you do not
      need to import it first.</p><p>The command prompt supports history (use the up and down cursor
      keys to recall previous commands). </p><p>Most of the commands listed below can be used in the
      in-program command line interface, using the embedding interface
      or using veusz_listen. Commands specific to particular modes are
      documented as such.</p><p>Veusz also includes a new object-oriented version of the
      interface, which is documented at
      <a class="ulink" href="http://barmag.net/veusz-wiki/EmbeddingPython" target="_top">http://barmag.net/veusz-wiki/EmbeddingPython</a>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51044016"></a>2. Commands</h2></div></div></div><p>We list the allowed set of commands below</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51045040"></a>2.1. Action</h3></div></div></div><a name="Command.Action"></a><p><span class="command"><strong>Action('actionname',
	componentpath='.')</strong></span></p><p>Initiates the specified action on the widget (component)
	given the action name. Actions perform certain automated
	routines. These include "fit" on a fit widget, and
	"zeroMargins" on grids.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51047648"></a>2.2. Add</h3></div></div></div><a name="Command.Add"></a><p><span class="command"><strong>Add('widgettype', name='nameforwidget',
        autoadd=True, optionalargs)</strong></span></p><p>The Add command adds a graph into the current widget
        (See the <a class="link" href="#Command.To">To</a> command to change
        the current position).</p><p>The first argument is the type of widget to add. These
        include "graph", "page", "axis", "xy" and
        "grid". <span class="command"><strong>name</strong></span> is the name of the new widget
        (if not given, it will be generated from the type of the
        widget plus a number). The <span class="command"><strong>autoadd</strong></span>
        parameter if set, constructs the default sub-widgets this
        widget has (for example, axes in a graph).</p><p>Optionally, default values for the graph settings may be
        given, for example <span class="command"><strong>Add('axis', name='y',
        direction='vertical')</strong></span>.</p><p>Subsettings may be set by using double underscores, for
	example <span class="command"><strong>Add('xy',
	MarkerFill__color='red', ErrorBarLine__hide=True)</strong></span>.</p><p>Returns: Name of widget added.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51055552"></a>2.3. AddCustom</h3></div></div></div><a name="Command.AddCustom"></a><p><span class="command"><strong>AddCustom(type, name, value)</strong></span></p><p>Add a custom definition for evaluation of
	expressions. This can define a constant (can be in terms of
	other constants), a function of 1 or more variables, or a
	function imported from an external python module.</p><p>ctype is "constant", "function" or "import".</p><p>name is name of constant, or "function(x, y, ...)" or
        module name.</p><p>val is definition for constant or function (both are
        _strings_), or is a list of symbols for a module (comma
        separated items in a string).</p><p>If mode is 'appendalways', the custom value is appended
        to the end of the list even if there is one with the same
        name. If mode is 'replace', it replaces any existing
        definition in the same place in the list or is appended
        otherwise. If mode is 'append', then an existing definition is
        deleted, and the new one appended to the end.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp46085808"></a>2.4. AddImportPath</h3></div></div></div><a name="Command.AddImportPath"></a><p><span class="command"><strong>AddImportPath(directory)</strong></span></p><p>Add a directory to the list of directories to try to
	import data from.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp46088432"></a>2.5. CloneWidget</h3></div></div></div><a name="Command.CloneWidget"></a><p><span class="command"><strong>CloneWidget(widget, newparent,
	newname=None)</strong></span></p><p>Clone the widget given, placing the copy in newparent
        and the name given.  newname is an optional new name to give
        it Returns new widget path.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp46091184"></a>2.6. Close</h3></div></div></div><a name="Command.Close"></a><p><span class="command"><strong>Close()</strong></span></p><p>Closes the plotwindow. This is only supported in
	embedded mode.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51076640"></a>2.7. CreateHistogram</h3></div></div></div><a name="Command.CreateHistogram"></a><p><span class="command"><strong>CreateHistogram(inexpr, outbinsds,
                        outvalsds, binparams=None, binmanual=None,
                        method='counts', cumulative = 'none',
                        errors=False)</strong></span></p><p>
	  Histogram an input expression.  inexpr is input expression.
        outbinds is the name of the dataset to create giving bin
        positions.  outvalsds is name of dataset for bin values.
        binparams is None or (numbins, minval, maxval, islogbins).
        binmanual is None or a list of bin values.  method is
        'counts', 'density', or 'fractions'.  cumulative is to
        calculate cumulative distributions which is 'none',
        'smalltolarge' or 'largetosmall'.  errors is to calculate
        Poisson error bars.
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51079824"></a>2.8. DatasetPlugin</h3></div></div></div><a name="Command.DatasetPlugin"></a><p><span class="command"><strong>DatasetPlugin(pluginname, fields,
	datasetnames={})&gt;</strong></span></p><p>
	  Use a dataset plugin.  pluginname: name of plugin to use
        fields: dict of input values to plugin datasetnames: dict
        mapping old names to new names of datasets if they are
        renamed. The new name None means dataset is deleted
	  </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51082496"></a>2.9. EnableToolbar</h3></div></div></div><a name="Command.EnableToolbar"></a><p><span class="command"><strong>EnableToolbar(enable=True)</strong></span></p><p>Enable/disable the zooming toolbar in the
	plotwindow. This command is only supported in embedded mode or
	from veusz_listen.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51085040"></a>2.10. Export</h3></div></div></div><a name="Command.Export"></a><p><span class="command"><strong>Export(filename, color=True,
      page=0 dpi=100,
      antialias=True, quality=85, backcolor='#ffffff00',
	pdfdpi=150, svgtextastext=False)</strong></span></p><p>Export the page given to the filename given. The
	<span class="command"><strong>filename</strong></span> must end with the correct
	extension to get the right sort of output file. Currrenly
	supported extensions are '.eps', '.pdf', '.svg', '.jpg',
	'.jpeg', '.bmp' and '.png'. If <span class="command"><strong>color</strong></span> is
	True, then the output is in colour, else
	greyscale. <span class="command"><strong>page</strong></span> is the page number of the
	document to export (starting from 0 for the first page!).
	<span class="command"><strong>dpi</strong></span> is the number of dots per inch for
	bitmap output files.  <span class="command"><strong>antialias</strong></span> -
	antialiases output if True. <span class="command"><strong>quality</strong></span> is a
	quality parameter for jpeg
	output. <span class="command"><strong>backcolor</strong></span> is the background color
	for bitmap files, which is a name or a #RRGGBBAA value (red,
	green, blue, alpha). <span class="command"><strong>pdfdpi</strong></span> is the dpi to
	use when exporting EPS or PDF
	files. <span class="command"><strong>svgtextastext</strong></span> says whether to export
	SVG text as text, rather than curves.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51093872"></a>2.11. ForceUpdate</h3></div></div></div><a name="Command.ForceUpdate"></a><p><span class="command"><strong>ForceUpdate()</strong></span></p><p>Force the window to be updated to reflect the current
	state of the document. Often used when periodic updates have
	been disabled (see SetUpdateInterval). This command is only
	supported in embedded mode or from veusz_listen.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51096512"></a>2.12. Get</h3></div></div></div><a name="Command.Get"></a><p><span class="command"><strong>Get('settingpath')</strong></span></p><p>Returns: The value of the setting given by the path.</p><div class="informalexample"><pre class="programlisting">
&gt;&gt;&gt; Get('/page1/graph1/x/min')
'Auto'
</pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51099920"></a>2.13. GetChildren</h3></div></div></div><a name="Command.GetChildren"></a><p><span class="command"><strong>GetChildren(where='.')</strong></span></p><p>Returns: The names of the widgets which are children of
      the path given</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51102416"></a>2.14. GetClick</h3></div></div></div><a name="Command.GetClick"></a><p><span class="command"><strong>GetClick()</strong></span></p><p>Waits for the user to click on a graph and returns the
	position of the click on appropriate axes. Command only works
	in embedded mode.</p><p>Returns: A list containing tuples of the form (axispath,
	val) for each axis for which the click was in range. The value
	is the value on the axis for the click.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51105536"></a>2.15. GetData</h3></div></div></div><a name="Command.GetData"></a><p><span class="command"><strong>GetData(name)</strong></span></p><p>Returns: For a 1D dataset, a tuple containing the
	dataset with the name given. The value is (data, symerr,
	negerr, poserr), with each a numpy array of the same size or
	None. data are the values of the dataset, symerr are the
	symmetric errors (if set), negerr and poserr and negative and
	positive asymmetric errors (if set). If a text dataset, return
	a list of text elements. If the dataset is a date-time
	dataset, return a list of Python datetime objects. If the
	dataset is a 2D dataset return the tuple (data, rangex,
	rangey), where data is a 2D numpy array and rangex/y are
	tuples giving the range of the x and y coordinates of the
	data.</p><div class="informalexample"><pre class="programlisting">
data = GetData('x')
SetData('x', data[0]*0.1, *data[1:])
</pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51109696"></a>2.16. GetDataType</h3></div></div></div><a name="Command.GetDataType"></a><p><span class="command"><strong>GetDataType(name)</strong></span></p><p>Get type of dataset with name given. Returns '1d' for a
	1d dataset, '2d' for a 2d dataset, 'text' for a text dataset
	and 'datetime' for a datetime dataset.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51112272"></a>2.17. GetDatasets</h3></div></div></div><a name="Command.GetDatasets"></a><p><span class="command"><strong>GetDatasets()</strong></span></p><p>Returns: The names of the datasets in the current
      document.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51114752"></a>2.18. GPL</h3></div></div></div><a name="Command.GPL"></a><p><span class="command"><strong>GPL()</strong></span></p><p>Print out the GNU Public Licence, which Veusz is licenced
      under.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51117232"></a>2.19. ImportFile</h3></div></div></div><a name="Command.ImportFile"></a><p><span class="command"><strong>ImportFile('filename', 'descriptor',
	    linked=False, prefix='', suffix='',
	    encoding='utf_8',
	    renames={})</strong></span></p><p>Imports data from a file. The arguments are the filename
	to load data from and the descriptor.</p><p>The format of the descriptor is a list of variable names
        representing the columns of the data. For more information see
        <a class="link" href="#Descriptors">Descriptors</a>.</p><p>If the linked parameter is set to True, if the document
	is saved, the data imported will not be saved with the
	document, but will be reread from the filename given the next
	time the document is opened. The linked parameter is
	optional.</p><p>If prefix and/or suffix are set, then the prefix and
	suffix are added to each dataset name. If set, renames maps
	imported dataset names to final dataset names after
	import.</p><p>Returns: A tuple containing a list of the imported
	datasets and the number of conversions which failed for a
	dataset.</p><p>Changed in version 0.5: A tuple is returned rather than
	just the number of imported variables.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51123264"></a>2.20. ImportFile2D</h3></div></div></div><a name="Command.ImportFile2D"></a><p><span class="command"><strong>ImportFile2D('filename', datasets,
xrange=(a,b), yrange=(c,d), invertrows=True/False,
invertcols=True/False, transpose=True/False,
prefix='', suffix='', linked=False,
encoding='utf8', renames={})</strong></span></p><p>Imports two-dimensional data from a file. The required
	arguments are the filename to load data from and the dataset
	name, or a list of names to use.</p><p>filename is a string which contains the filename to
	use. datasets is either a string (for a single dataset), or a
	list of strings (for multiple datasets).</p><p>The xrange parameter is a tuple which contains the range
	of the X-axis along the two-dimensional dataset, for example
	(-1., 1.) represents an inclusive range of -1 to 1. The yrange
	parameter specifies the range of the Y-axis similarly. If they
	are not specified, (0, N) is the default, where N is the
	number of datapoints along a particular axis.</p><p>invertrows and invertcols if set to True, invert the
	rows and columns respectively after they are read by
	Veusz. transpose swaps the rows and columns.</p><p>If prefix and/or suffix are set, they are prepended or
	appended to imported dataset names. If set, renames maps imported
	dataset names to final dataset names  after import.</p><p>If the linked parameter is True, then the datasets are
	linked to the imported file, and are not saved within a saved
	document.</p><p>The file format this command accepts is a
	two-dimensional matrix of numbers, with the columns separated
	by spaces or tabs, and the rows separated by new
	lines. The X-coordinate is taken to be in the direction of the
	columns. Comments are supported (use "#", "!" or "%"), as are
	continuation characters ("\"). Separate datasets are
	deliminated by using blank lines.</p><p>In addition to the matrix of numbers, the various
	optional parameters this command takes can also be specified
	in the data file. These commands should be given on separate
	lines before the matrix of numbers. They are:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>xrange A B</p></li><li class="listitem"><p>yrange C D</p></li><li class="listitem"><p>invertrows</p></li><li class="listitem"><p>invertcols</p></li><li class="listitem"><p>transpose</p></li></ol></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51133824"></a>2.21. ImportFileCSV</h3></div></div></div><a name="Command.ImportFileCSV"></a><p><span class="command"><strong>ImportFileCSV('filename', readrows=False,
	    dsprefix='', dssuffix='', linked=False, encoding='utf_8',
	    renames={})
	</strong></span></p><p>This command imports data from a CSV format file. Data
	  are read from the file using the dataset names given at the
	  top of the files in columns. Please see the reading data
	  section of this manual for more information. dsprefix is
	  prepended to each dataset name and dssuffix is added (the
	  prefix option is deprecated and also addeds an underscore to
	  the dataset name). linked specifies whether the data will be
	  linked to the file. renames, if set, provides new names for
	  datasets after import.
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51136896"></a>2.22. ImportFileHDF5</h3></div></div></div><a name="Command.ImportFileHDF5"></a><p>
	  <span class="command"><strong>ImportFileHDF5(filename, items, namemap={},
	  slices={}, twodranges={}, twod_as_oned=set([]),
	  convert_datetime={}, prefix='', suffix='', renames={},
	  linked=False)</strong></span>
	</p><p>
	  Import data from a HDF5 file. items is a list of groups and
	  datasets which can be imported.  If a group is imported, all
	  child datasets are imported.  namemap maps an input dataset
	  to a veusz dataset name. Special suffixes can be used on the
	  veusz dataset name to indicate that the dataset should be
	  imported specially.
	</p><pre class="programlisting">
'foo (+)': import as +ve error for dataset foo
'foo (-)': import as -ve error for dataset foo
'foo (+-)': import as symmetric error for dataset foo
	</pre><p>
	  slices is an optional dict specifying slices to be selected
	  when importing. For each dataset to be sliced, provide a
	  tuple of values, one for each dimension. The values should
	  be a single integer to select that index, or a tuple (start,
	  stop, step), where the entries are integers or None.
	</p><p> twodranges is an optional dict giving data ranges for
	2d datasets. It maps names to (minx, miny, maxx, maxy).
	twod_as_oned: optional set containing 2d datasets to attempt
	to read as 1d
	</p><p>
	  convert_datetime should be a dict mapping hdf name to
	  specify date/time importing.  For a 1d numeric dataset: if
	  this is set to 'veusz', this is the number of seconds since
	  2009-01-01, if this is set to 'unix', this is the number of
	  seconds since 1970-01-01.  For a text dataset, this should
	  give the format of the date/time,
	  e.g. 'YYYY-MM-DD|T|hh:mm:ss' or 'iso' for iso format.
	</p><p>
	  renames is a dict mapping old to new dataset names, to be
	  renamed after importing.  linked specifies that the dataset
	  is linked to the file.
	</p><pre class="programlisting">
    Attributes can be used in datasets to override defaults:
     'vsz_name': set to override name for dataset in veusz
     'vsz_slice': slice on importing (use format "start:stop:step,...")
     'vsz_range': should be 4 item array to specify x and y ranges:
                  [minx, miny, maxx, maxy]
     'vsz_twod_as_oned': treat 2d dataset as 1d dataset with errors
     'vsz_convert_datetime': treat as date/time, set to one of the values
                             above.
	</pre><p>
	  For compound datasets these attributes can be given on a
	  per-column basis using attribute names
	  vsz_attributename_columnname.
	</p><p>
	  Returns: list of imported datasets
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51145584"></a>2.23. ImportFilePlugin</h3></div></div></div><a name="Command.ImportFilePlugin"></a><p><span class="command"><strong>ImportFilePlugin('pluginname', 'filename',
	    **pluginargs, linked=False, encoding='utf_8',
	    prefix='', suffix='', renames={})</strong></span></p><p>
	  Import data from file using import plugin 'pluginname'. The
	  arguments to the plugin are given, plus optionally a text
	  encoding, and prefix and suffix to prepend or append to
	  dataset names.  renames, if set, provides new names for
	  datasets after import.
	</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51148416"></a>2.24. ImportFITSFile</h3></div></div></div><a name="Command.ImportFITSFile"></a><p><span class="command"><strong>ImportFITSFile(datasetname, filename, hdu,
	    datacol='A', symerrcol='B', poserrcol='C', negerrcol='D',
	    linked=True/False, renames={})</strong></span></p><p>This command does a simple import from a FITS file. The
FITS format is used within the astronomical community to transport
binary data. For a more powerful FITS interface, you can use PyFITS
within your scripts.</p><p>The datasetname is the name of the dataset to import,
the filename is the name of the FITS file to import from. The hdu
parameter specifies the HDU to import data from (numerical or a
name).</p><p>If the HDU specified is a primary HDU or image
	extension, then a two-dimensional dataset is loaded from the
	file. The optional parameters (other than linked) are
	ignored. Any WCS information within the HDU are used to
	provide a suitable xrange and yrange.</p><p>If the HDU is a table, then the datacol parameter must
	be specified (and optionally symerrcol, poserrcol and
	negerrcol). The dataset is read in from the named column in
	the table. Any errors are read in from the other specified
	columns.</p><p>If linked is True, then the dataset is not saved with a
	saved document, but is reread from the data file each time the
	document is loaded.  renames, if set, provides new names for
	datasets after import.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51153696"></a>2.25. ImportString</h3></div></div></div><a name="Command.ImportString"></a><p><span class="command"><strong>ImportString('descriptor',
	'data')</strong></span></p><p>Like, <a class="link" href="#Command.ImportFile">ImportFile</a>, but loads the
	data from the specfied string rather than a file. This allows
	data to be easily embedded within a document. The data string is
	usually a multi-line Python string.</p><p>Returns: A tuple containing a list of the imported
	datasets and the number of conversions which failed for a
	dataset.</p><p>Changed in version 0.5: A tuple is returned rather than
	just the number of imported variables.</p><div class="informalexample"><pre class="programlisting">
ImportString('x y', '''
1   2
2   5
3   10
''')
</pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51158928"></a>2.26. ImportString2D</h3></div></div></div><a name="Command.ImportString2D"></a><p><span class="command"><strong>ImportString2D(datasets,	string)</strong></span></p><p>Imports a two-dimensional dataset from the string
	given. This is similar to the <a class="link" href="#Command.ImportFile2D">ImportFile2D</a> command,
	with the same dataset format within the string. This command,
	however, does not currently take any optional parameters. The
	various controlling parameters can be set within the
	string. See the <a class="link" href="#Command.ImportFile2D">ImportFile2D</a> section for
	details.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51162896"></a>2.27. IsClosed</h3></div></div></div><a name="Command.IsClosed"></a><p><span class="command"><strong>IsClosed()</strong></span></p><p>Returns a boolean value telling the caller whether the
	plotting window has been closed.
	</p><p>Note: this command is only supported in the embedding
	interface.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51165872"></a>2.28. List</h3></div></div></div><a name="Command.List"></a><p><span class="command"><strong>List(where='.')</strong></span></p><p>List the widgets which are contained within the widget
      with the path given, the type of widgets, and a brief
      description.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51168416"></a>2.29. Load</h3></div></div></div><a name="Command.Load"></a><p><span class="command"><strong>Load('filename.vsz')</strong></span></p><p>Loads the veusz script file given. The script file can
	be any Python code. The code is executed using the Veusz
	interpreter.</p><p>Note: this command is only supported at the command line
	and not in a script. Scripts may use the python
	<span class="command"><strong>execfile</strong></span> function instead.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51172096"></a>2.30. MoveToPage</h3></div></div></div><a name="Command.MoveToPage"></a><p><span class="command"><strong>MoveToPage(pagenum)</strong></span></p><p>Updates window to show the page number given of the
	document.</p><p>Note: this command is only supported in the embedding
	interface or veusz_listen.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51175056"></a>2.31. ReloadData</h3></div></div></div><a name="Command.ReloadData"></a><p><span class="command"><strong>ReloadData()</strong></span></p><p>Reload any datasets which have been linked to
	files.</p><p>Returns: A tuple containing a list of the imported
	datasets and the number of conversions which failed for a
	dataset.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51177968"></a>2.32. Rename</h3></div></div></div><a name="Command.Rename"></a><p><span class="command"><strong>Remove('widgetpath', 'newname')</strong></span></p><p>Rename the widget at the path given to a new name. This
	command does not move widgets.  See <a class="link" href="#Command.To">To</a> for a description of the path
	syntax. '.' can be used to select the current widget.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51181200"></a>2.33. Remove</h3></div></div></div><a name="Command.Remove"></a><p><span class="command"><strong>Remove('widgetpath')</strong></span></p><p>Remove the widget selected using the path. See <a class="link" href="#Command.To">To</a> for a description of the path
	syntax.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51184224"></a>2.34. ResizeWindow</h3></div></div></div><a name="Command.ResizeWindow"></a><p><span class="command"><strong>ResizeWindow(width, height)</strong></span></p><p>Resizes window to be width by height pixels.</p><p>Note: this command is only supported in the embedding
	interface or veusz_listen.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51187104"></a>2.35. Save</h3></div></div></div><a name="Command.Save"></a><p><span class="command"><strong>Save('filename.vsz')</strong></span></p><p>Save the current document under the filename
	given.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51189504"></a>2.36. Set</h3></div></div></div><a name="Command.Set"></a><p><span class="command"><strong>Set('settingpath', val)</strong></span></p><p>Set the setting given by the path to the value given. If
	the type of <span class="command"><strong>val</strong></span> is incorrect, an
	<span class="command"><strong>InvalidType</strong></span> exception is thrown. The path
	to the setting is the optional path to the widget the setting
	is contained within, an optional subsetting specifier, and the
	setting itself.</p><div class="informalexample"><pre class="programlisting">
Set('page1/graph1/x/min', -10.)
</pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51194432"></a>2.37. SetAntiAliasing</h3></div></div></div><a name="Command.SetAntiAliasing"></a><p><span class="command"><strong>SetAntiAliasing(on)</strong></span></p><p>Enable or disable anti aliasing in the plot
	window, replotting the image.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51196928"></a>2.38. SetData</h3></div></div></div><a name="Command.SetData"></a><p><span class="command"><strong>SetData(name, val, symerr=None, negerr=None,
      poserr=None)</strong></span></p><p>Set the dataset name with the values given. If None is
      given for an item, it will be left blank. val is the actual
      data, symerr are the symmetric errors, negerr and poserr and the
      getative and positive asymmetric errors. The data can be given
      as lists or numpys.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51199712"></a>2.39. SetDataExpression</h3></div></div></div><a name="Command.SetDataExpression"></a><p><span class="command"><strong>SetDataExpression(name, val, symerr=None, negerr=None,
      poserr=None, linked=False, parametric=None)</strong></span></p><p>Create a new dataset based on the expressions given. The
	expressions are Python syntax expressions based on existing
	datasets.
</p><p>If linked is True, the dataset will change as the
	datasets in the expressions change.</p><p>Parametric can be set to a tuple of (minval, maxval,
	numitems). <span class="command"><strong>t</strong></span> in the expression will iterate
	from minval to maxval in numitems values.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51204048"></a>2.40. SetDataRange</h3></div></div></div><a name="Command.SetDataRange"></a><p><span class="command"><strong>SetDataRange(name, numsteps, val, symerr=None,
	    negerr=None, poserr=None, linked=False)</strong></span></p><p>Set dataset to be a range of values with numsteps
	steps. val is tuple made up of (minimum value, maximum
	value). symerr, negerr and poserr are optional tuples for the
	error bars.</p><p>If linked is True, the dataset can be saved in a
	document as a SetDataRange, otherwise it is expanded to the
	values which would make it up.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51207296"></a>2.41. SetData2D</h3></div></div></div><a name="Command.SetData2D"></a><p><span class="command"><strong>SetData2D('name', val, xrange=(A,B),
	yrange=(C,D), xgrid=[1,2,3...],
	ygrid=[4,5,6...])</strong></span></p><p>Creates a two-dimensional dataset with the name
	given. val is either a two-dimensional numpy array, or is a
	list of lists, with each list in the list representing a
	row. Do not give xrange if xgrid is set and do not give yrange
	if ygrid is set, and vice versa.</p><p>xrange and yrange are optional tuples giving the
	inclusive range of the X and Y coordinates of the data. xgrid
	and ygrid are optional lists, tuples or arrays which give the
	coordinates of the edges of the pixels. There should be one
	more item in each array than pixels.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51210768"></a>2.42. SetData2DExpression</h3></div></div></div><a name="Command.SetData2DExpression"></a><p><span class="command"><strong>SetData2DExpression('name', expr, linked=False)</strong></span></p><p>Create a 2D dataset based on expressions.  name is the
        new dataset name expr is an expression which should return a
        2D array linked specifies whether to permanently link the
        dataset to the expressions.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51213408"></a>2.43. SetData2DExpressionXYZ</h3></div></div></div><a name="Command.SetData2DExpressionXYZ"></a><p><span class="command"><strong>SetData2DExpressionXYZ('name', 'xexpr',
	'yexpr', 'zexpr', linked=False)</strong></span></p><p>Create a 2D dataset based on three 1D expressions. The
	x, y expressions need to evaluate to a grid of x, y points,
	with the z expression as the 2D value at that point. Currently
	only linear fixed grids are supported. This function is
	intended to convert calculations or measurements at fixed
	points into a 2D dataset easily. Missing values are filled
	with NaN.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51216288"></a>2.44. SetData2DXYFunc</h3></div></div></div><a name="Command.SetData2DXYFunc"></a><p><span class="command"><strong>SetData2DXYFunc('name', xstep, ystep, 'expr',
	linked=False)</strong></span></p><p>Construct a 2D dataset using a mathematical expression
	of "x" and "y". The x values are specified as (min, max, step)
	in xstep as a tuple, the y values similarly. If linked remains
	as False, then a real 2D dataset is created, where values can
	be modified and the data are stored in the saved file.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51219088"></a>2.45. SetDataDateTime</h3></div></div></div><a name="Command.SetDataDateTime"></a><p><span class="command"><strong>SetDataDateTime('name', vals)</strong></span></p><p>Creates a datetime dataset of name given. vals is a list
	of Python datetime objects.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51221584"></a>2.46. SetDataText</h3></div></div></div><a name="Command.SetDataText"></a><p><span class="command"><strong>SetDataText(name, val)</strong></span></p><p>Set the text dataset name with the values given.
	  <span class="command"><strong>val</strong></span> must be a type that can be converted into a
	  Python list.</p><div class="informalexample"><pre class="programlisting">
SetDataText('mylabel', ['oranges', 'apples', 'pears', 'spam'])
</pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51225776"></a>2.47. SetToReference</h3></div></div></div><a name="Command.SetToReference"></a><p><span class="command"><strong>SetToReference(setting, refval)</strong></span></p><p>Set setting to match other setting refval
	always..</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51228176"></a>2.48. SetUpdateInterval</h3></div></div></div><a name="Command.SetUpdateInterval"></a><p><span class="command"><strong>SetUpdateInterval(interval)</strong></span></p><p>Tells window to update every interval milliseconds at
	most. The value 0 disables updates until this function is
	called with a non-zero. The value -1 tells Veusz to update the
	window every time the document has changed. This will make
	things slow if repeated changes are made to the
	document. Disabling updates and using the ForceUpdate command
	will allow the user to control updates directly.</p><p>Note: this command is only supported in the embedding
	interface or veusz_listen.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51231472"></a>2.49. SetVerbose</h3></div></div></div><a name="Command.SetVerbose"></a><p><span class="command"><strong>SetVerbose(v=True)</strong></span></p><p>If <span class="command"><strong>v</strong></span> is <span class="command"><strong>True</strong></span>, then extra
	information is printed out by commands.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51235120"></a>2.50. StartSecondView</h3></div></div></div><a name="Command.StartSecondView"></a><p><span class="command"><strong>StartSecondView(name = 'window
	title')</strong></span></p><p>In the embedding interface, this method will open a new
	Embedding interface onto the same document, returning the
	object. This new window provides a second view onto the
	document. It can, for instance, show a different page to the
	primary view. name is a window title for the new
	window.</p><p>Note: this command is only supported in the embedding
	interface.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51238288"></a>2.51. TagDatasets</h3></div></div></div><a name="Command.TagDatasets"></a><p><span class="command"><strong>TagDatasets('tag', ['ds1', 'ds2'...])</strong></span></p><p>Adds the tag to the list of datasets given..</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51240688"></a>2.52. To</h3></div></div></div><a name="Command.To"></a><p><span class="command"><strong>To('widgetpath')</strong></span></p><p>The To command takes a path to a widget and moves to
        that widget. For example, this may be "/", the root widget,
        "graph1", "/page1/graph1/x", "../x". The syntax is designed to
        mimic Unix paths for files. "/" represents the base widget
        (where the pages reside), and ".." represents the widget next
        up the tree.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51243456"></a>2.53. Quit</h3></div></div></div><a name="Command.Quit"></a><p><span class="command"><strong>Quit()</strong></span></p><p>Quits Veusz. This is only supported in
	veusz_listen.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51245856"></a>2.54. WaitForClose</h3></div></div></div><a name="Command.WaitForClose"></a><p><span class="command"><strong>WaitForClose()</strong></span></p><p>Wait until the plotting window has been closed.
	</p><p>Note: this command is only supported in the embedding
	interface.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51248720"></a>2.55. Zoom</h3></div></div></div><a name="Command.Zoom"></a><p><span class="command"><strong>Zoom(factor)</strong></span></p><p>Sets the plot zoom factor, relative to a 1:1
	scaling. factor can also be "width", "height" or "page", to zoom
	to the page width, height or page, respectively.</p><p>This is only supported in embedded mode or
	veusz_listen.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51251888"></a>3. Security</h2></div></div></div><p>With the 1.0 release of Veusz, input scripts and
      expressions are checked for possible security risks. Only a
      limited subset of Python functionality is allowed, or a dialog
      box is opened allowing the user to cancel the
      operation. Specifically you cannot import modules, get
      attributes of Python objects, access globals() or locals() or do
      any sort of file reading or manipulation. Basically anything
      which might break in Veusz or modify a system is not
      supported. In addition internal Veusz functions which can modify
      a system are also warned against, specifically Print(), Save()
      and Export().</p><p>If you are running your own scripts and do not want to be
      bothered by these dialogs, you can run veusz with the
      <span class="command"><strong>--unsafe-mode</strong></span> option.</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="idp51254992"></a>Chapter 4. Using Veusz from other programs</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="#idp51255632">1. Non-Qt Python programs</a></span></dt><dd><dl><dt><span class="section"><a href="#idp51257872">1.1. Older path-based interface</a></span></dt><dt><span class="section"><a href="#idp51279488">1.2. New-style object interface</a></span></dt><dt><span class="section"><a href="#idp51299440">1.3. Translating old to new style</a></span></dt></dl></dd><dt><span class="section"><a href="#idp51303744">2. PyQt4 programs</a></span></dt><dt><span class="section"><a href="#idp51305008">3. Non Python programs</a></span></dt><dt><span class="section"><a href="#idp51316400">4. C, C++ and Fortran</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51255632"></a>1. Non-Qt Python programs</h2></div></div></div><p>
	Veusz can be used as a Python module for plotting data. There
	are two ways to use the module: (1) with an older path-based
	Veusz commands, used in Veusz saved document files or (2)
	using an object-oriented interface. With the old style method
	the user uses a unix-path inspired API to navigate the widget
	tree and add or manipulate widgets. With the new style
	interface, the user navigates the tree with attributes of the
	<code class="literal">Root</code> object to access Nodes. The new
	interface is likely to be easier to use unless you are
	directly translating saved files.
      </p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51257872"></a>1.1. Older path-based interface</h3></div></div></div><pre class="programlisting">
"""An example embedding program. Veusz needs to be installed into
the Python path for this to work (use setup.py)

This animates a sin plot, then finishes
"""

import time
import numpy
import veusz.embed as veusz

# construct a Veusz embedded window
# many of these can be opened at any time
g = veusz.Embedded('window title')
g.EnableToolbar()

# construct the plot
g.To( g.Add('page') )
g.To( g.Add('graph') )
g.Add('xy', marker='tiehorz', MarkerFill__color='green')

# this stops intelligent axis extending
g.Set('x/autoExtend', False)
g.Set('x/autoExtendZero', False)

# zoom out
g.Zoom(0.8)

# loop, changing the values of the x and y datasets
for i in range(10):
    x = numpy.arange(0+i/2., 7.+i/2., 0.05)
    y = numpy.sin(x)
    g.SetData('x', x)
    g.SetData('y', y)

    # wait to animate the graph
    time.sleep(2)

# let the user see the final result
print "Waiting for 10 seconds"
time.sleep(10)
print "Done!"

# close the window (this is not strictly necessary)
g.Close()
	</pre><p>
	  The embed interface has the methods listed in the command
	  line interface listed in the Veusz manual
	  http://home.gna.org/veusz/docs/manual.html
	</p><p>
	  Multiple Windows are supported by creating more than one
	  <code class="literal">Embedded</code> object. Other useful methods
	  include:
	</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="literal">WaitForClose()</code> - wait until
	    window has closed</p></li><li class="listitem"><p><code class="literal">GetClick()</code> - return a list of
	    <code class="literal">(axis, value)</code> tuples where the user
	    clicks on a graph</p></li><li class="listitem"><p><code class="literal">ResizeWndow(width, height)</code> -
	    resize window to be <code class="literal">width</code> x
	    <code class="literal">height</code> pixels</p></li><li class="listitem"><p><code class="literal">SetUpdateInterval(interval)</code> - set
	    update interval in ms or 0 to disable
	    </p></li><li class="listitem"><p><code class="literal">MoveToPage(page)</code> - display page
	    given (starting from 1) </p></li><li class="listitem"><p><code class="literal">IsClosed()</code> - has the page been
	    closed</p></li><li class="listitem"><p><code class="literal">Zoom(factor)</code> - set zoom level
	    (float) or 'page', 'width', 'height'</p></li><li class="listitem"><p><code class="literal">Close()</code> - close window
	    </p></li><li class="listitem"><p><code class="literal">SetAntiAliasing(enable)</code> - enable
	    or disable antialiasing </p></li><li class="listitem"><p><code class="literal">EnableToolbar(enable=True)</code> -
	    enable plot toolbar</p></li><li class="listitem"><p><code class="literal">StartSecondView(name='Veusz')</code> -
	    start a second view onto the document of the current
	    <code class="literal">Embedded</code> object. Returns a new
	    <code class="literal">Embedded</code> object.</p></li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51279488"></a>1.2. New-style object interface</h3></div></div></div><p>
	  In versions of Veusz &gt;1.8 is a new style of object
	  interface, which makes it easier to construct the widget
	  tree. Each widget, group of settings or setting is stored as
	  a Node object, or its subclass, in a tree. The root document
	  widget can be accessed with the <code class="literal">Root</code> object. The dot
	  operator "." finds children inside other nodes. In Veusz
	  some widgets can contain other widgets (Root, pages, graphs,
	  grids). Widgets contain setting nodes, accessed as
	  attributes. Widgets can also contain groups of settings,
	  again accessed as attributes.
	</p><p>An example tree for a document (not complete) might look like this</p><pre class="programlisting">
Root
\-- page1                     (page widget)
    \-- graph1                (graph widget)
        \--  x                (axis widget)
        \--  y                (axis widget)
        \-- function          (function widget)
    \-- grid1                 (grid widget)
        \-- graph2            (graph widget)
            \-- xy1           (xy widget)
                \-- xData     (setting)
                \-- yData     (setting)
                \-- PlotLine  (setting group)
                    \-- width (setting)
                    ...
                ...
            \-- x             (axis widget)
            \-- y             (axis widget)
        \-- graph3            (graph widget)
            \-- contour1      (contour widget)
            \-- x             (axis widget)
            \-- y             (axis widget)
	</pre><p>Here the user could access the xData setting node of the
	xy1 widget using <code class="literal">Root.page1.graph2.xy1.xData</code>. To
	actually read or modify the value of a setting, you should get
	or set the <code class="literal">val</code> property of the setting node. The line
	width could be changed like this</p><pre class="programlisting">
graph = embed.Root.page1.graph2
graph.xy1.PlotLine.width.val = '2pt'
	</pre><p>
	  For instance, this constructs a simple x-squared plot which
	  changes to x-cubed:
	</p><pre class="programlisting">
import veusz.embed as veusz
import time

#  open a new window and return a new Embedded object
embed = veusz.Embedded('window title')
#  make a new page, but adding a page widget to the root widget
page = embed.Root.Add('page')
#  add a new graph widget to the page
graph = page.Add('graph')
#  add a function widget to the graph. The Add() method can take a list of settings
#  to set after widget creation. Here, "function='x**2'" is equivalent to
#  function.function.val = 'x**2'
function = graph.Add('function', function='x**2')

time.sleep(2)
function.function.val = 'x**3'
#  this is the same if the widgets have the default names
Root.page1.graph1.function1.function.val = 'x**3'
	</pre><p>
	  If the document contains a page called "page1" then
	  <code class="literal">Root.page1</code> is the object representing the
	  page. Similarly, <code class="literal">Root.page1.graph1</code> is a graph called
	  <code class="literal">graph1</code> in the page. You can also use dictionary-style
	  indexing to get child widgets,
	  e.g. Root['page1']['graph1']. This style is easier to use if
	  the names of widgets contain spaces or if widget names
	  shadow methods or properties of the Node object, i.e. if you
	  do not control the widget names.
	</p><p>
	  Widget nodes can contain as children other widgets, groups
	  of settings, or settings. Groups of settings can contain
	  child settings. Settings cannot contain other nodes. Here
	  are the useful operations of Nodes:
	</p><pre class="programlisting">
class Node(object):
  """properties:
    path - return path to object in document, e.g. /page1/graph1/function1
    type - type of node: "widget", "settinggroup" or "setting"
    name - name of this node, e.g. "graph1"
    children - a generator to return all the child Nodes of this Node, e.g.
      for c in Root.children:
        print c.path
    children_widgets - generator to return child widget Nodes of this Node
    children_settinggroups - generator for child setting groups of this Node
    children_settings - a generator to get the child settings
    childnames - return a list of the names of the children of this Node
    childnames_widgets - return a list of the names of the child widgets
    childnames_settinggroups - return a list of the names of the setting groups
    childnames_settings - return a list of the names of the settings
    parent - return the Node corresponding to the parent widget of this Node

    __getattr__ - get a child Node with name given, e.g. Root.page1
    __getitem__ - get a child Node with name given, e.g. Root['page1']
  """

  def fromPath(self, path):
     """Returns a new Node corresponding to the path given, e.g. '/page1/graph1'"""

class SettingNode(Node):
    """A node which corresponds to a setting. Extra properties:
    val - get or set the setting value corresponding to this value, e.g.
     Root.page1.graph1.leftMargin.val = '2cm'
    """

class SettingGroupNode(Node):
    """A node corresponding to a setting group. No extra properties."""

class WidgetNode(Node):
    """A node corresponding to a widget.

       property:
         widgettype - get Veusz type of widget

       Methods are below."""

    def WalkWidgets(self, widgettype=None):
        """Generator to walk widget tree and get widgets below this
        WidgetNode of type given.

        widgettype is a Veusz widget type name or None to get all
        widgets."""

    def Add(self, widgettype, *args, **args_opt):
        """Add a widget of the type given, returning the Node instance.
        """

    def Rename(self, newname):
        """Renames widget to name given.
        Existing Nodes corresponding to children are no longer valid."""

    def Action(self, action):
        """Applies action on widget."""

    def Remove(self):
        """Removes a widget and its children.
        Existing Nodes corresponding to children are no longer valid."""
	</pre><p>
	  Note that Nodes are temporary objects which are created on
	  the fly. A real widget in Veusz can have several different
	  WidgetNode objects. The operators == and != can test whether
	  a Node points to the same widget, setting or setting group.
	</p><p>
	  Here is an example to set all functions in the document to
	  be <code class="literal">x**2</code>:
	</p><pre class="programlisting">
for n in Root.WalkWidgets(widgettype='function'):
  n.function.val = 'x**2'
	</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp51299440"></a>1.3. Translating old to new style</h3></div></div></div><p>
	  Here is an example how you might translate the old to new
	  style interface (this is taken from the <code class="literal">sin.vsz</code>
	  example).
	</p><pre class="programlisting">
# old (from saved document file)
Add('page', name='page1')
To('page1')
Add('graph', name='graph1', autoadd=False)
To('graph1')
Add('axis', name='x')
To('x')
Set('label', '\\italic{x}')
To('..')
Add('axis', name='y')
To('y')
Set('label', 'sin \\italic{x}')
Set('direction', 'vertical')
To('..')
Add('xy', name='xy1')
To('xy1')
Set('MarkerFill/color', 'cyan')
To('..')
Add('function', name='function1')
To('function1')
Set('function', 'sin(x)')
Set('Line/color', 'red')
To('..')
To('..')
To('..')
	</pre><pre class="programlisting">
# new (in python)
import veusz.embed
embed = veusz.embed.Embedded('window title')

page = embed.Root.Add('page')
# note: autoAdd=False stops graph automatically adding own axes (used in saved files)
graph = page.Add('graph', autoadd=False)
x = graph.Add('axis', name='x')
x.label.val = '\\italic{x}'
y = graph.Add('axis', name='y')
y.direction.val = 'vertical'
xy = graph.Add('xy')
xy.MarkerFill.color.val = 'cyan'
func = graph.Add('function')
func.function.val = 'sin(x)'
func.Line.color.val = 'red'
	</pre></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51303744"></a>2. PyQt4 programs</h2></div></div></div><p>There is no direct PyQt4 interface. The standard
      embedding interface should work, however.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51305008"></a>3. Non Python programs</h2></div></div></div><p>Support for non Python programs is available in a limited
      form. External programs may execute the
      <span class="command"><strong>veusz_listen</strong></span> executable or
      <span class="command"><strong>veusz_listen.py</strong></span> Python module. Veusz will
      read its input from the standard input, and write output to
      standard output. This is a full Python execution environment,
      and supports all the scripting commands mentioned in <a class="link" href="#Commands">Commands</a>, a <span class="command"><strong>Quit()</strong></span>
      command, the <span class="command"><strong>EnableToolbar()</strong></span> and the
      <span class="command"><strong>Zoom(factor)</strong></span> command listed above. Only one
      window is supported at once, but many
      <span class="command"><strong>veusz_listen</strong></span> programs may be started.</p><p><span class="command"><strong>veusz_listen</strong></span> may be used from the shell
      command line by doing something like:</p><div class="informalexample"><pre class="programlisting">
veusz_listen &lt; in.vsz
</pre></div><p>where <span class="command"><strong>in.vsz</strong></span> contains:</p><div class="informalexample"><pre class="programlisting">
To(Add('page') )
To(Add('graph') )
SetData('x', arange(20))
SetData('y', arange(20)**2)
Add('xy')
Zoom(0.5)
Export("foo.eps")
Quit()
</pre></div><p>A program may interface with Veusz in this way by using the
    <span class="command"><strong>popen</strong></span> C Unix function, which allows a program
    to be started having control of its standard input and
    output. Veusz can then be controlled by writing commands to an
    input pipe.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp51316400"></a>4. C, C++ and Fortran</h2></div></div></div><p>A callable library interface to Veusz is on my todo list
      for C, C++ and Fortran. Please tell me if you would be
      interested in this option.</p></div></div></div></body></html>