1"====================================================================== 2| 3| GNUPlot bindings style classes 4| 5| 6 ======================================================================" 7 8"====================================================================== 9| 10| Copyright 2007, 2008 Free Software Foundation, Inc. 11| Written by Paolo Bonzini. 12| 13| This file is part of GNU Smalltalk. 14| 15| GNU Smalltalk is free software; you can redistribute it and/or modify 16| it under the terms of the GNU General Public License as published by 17| the Free Software Foundation; either version 2, or (at your option) 18| any later version. 19| 20| GNU Smalltalk is distributed in the hope that it will be useful, but 21| WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 22| or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 23| for more details. 24| 25| You should have received a copy of the GNU General Public License 26| along with GNU Smalltalk; see the file COPYING. If not, write to the 27| Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 28| 02110-1301, USA. 29| 30 ======================================================================" 31 32"The GPSeriesStyle class is Copyright (c) 2007 Igor Stasenko 33 and licensed under the X11 license. 34 35 Permission is hereby granted, free of charge, to any person 36 obtaining a copy of this software and associated documentation 37 files (the `Software'), to deal in the Software without 38 restriction, including without limitation the rights to use, 39 copy, modify, merge, publish, distribute, sublicense, and/or sell 40 copies of the Software, and to permit persons to whom the 41 Software is furnished to do so, subject to the following 42 conditions: 43 44 The above copyright notice and this permission notice shall be 45 included in all copies or substantial portions of the Software. 46 47 THE SOFTWARE IS PROVIDED `AS IS', WITHOUT WARRANTY OF ANY KIND, 48 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 49 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 50 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 51 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 52 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 53 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 54 OTHER DEALINGS IN THE SOFTWARE." 55 56GPRectangleStyle subclass: GPSeriesStyle [ 57 <category: 'GNUPlot'> 58 <comment: 'My instances are used to customize the appearance of a plotted 59function or data set.'> 60 61 | x2 y2 title | 62 63 initialize [ 64 <category: 'initialization'> 65 super initialize. 66 x2 := y2 := false 67 ] 68 69 y2 [ 70 <category: 'axes'> 71 ^y2 72 ] 73 74 y2: aBoolean [ 75 <category: 'axes'> 76 y2 := aBoolean 77 ] 78 79 x2 [ 80 <category: 'axes'> 81 ^x2 82 ] 83 84 x2: aBoolean [ 85 <category: 'axes'> 86 x2 := aBoolean 87 ] 88 89 fillStyle [ 90 <category: 'styles'> 91 ^params at: #fillstyle ifAbsent: [ #empty ] 92 ] 93 94 notitle [ 95 "The line title and sample can be omitted from the key by using the keyword notitle" 96 97 <category: 'title'> 98 title := 'notitle' 99 ] 100 101 pointSize: aParam [ 102 "You may also scale the line width and point size for a plot by using <line width> and <point size>, 103 which are specified relative to the default values for each terminal. The pointsize may also be altered 104 globally � see set pointsize (p. 111) for details. But note that both <point size> as set here and 105 as set by set pointsize multiply the default point size � their effects are not cumulative. That is, set 106 pointsize 2; plot x w p ps 3 will use points three times default size, not six. 107 108 It is also possible to specify pointsize variable either as part of a line style or for an individual plot. 109 In this case one extra column of input is required, i.e. 3 columns for a 2D plot and 4 columns for a 3D 110 splot. The size of each individual point is determined by multiplying the global pointsize by the value 111 read from the data file." 112 113 <category: 'styles'> 114 params at: #pointsize put: aParam 115 ] 116 117 pointType: aNumber [ 118 "If you wish to choose the line or point type for a single plot, <line type> and <point type> may be 119 specified. These are positive integer constants (or expressions) that specify the line type and point type 120 to be used for the plot." 121 122 <category: 'styles'> 123 params at: #pointtype put: aNumber 124 ] 125 126 axes [ 127 | axes | 128 axes := 'axes x1y1' copy. 129 self x2 ifTrue: [ axes at: 7 put: $2 ]. 130 self y2 ifTrue: [ axes at: 9 put: $2 ]. 131 ^axes 132 ] 133 134 titleFor: aSeries [ 135 title notNil ifTrue: [ ^title ]. 136 ^aSeries defaultTitle 137 ifNil: [ 'notitle' ] 138 ifNotNil: [ :defaultTitle | 'title ', defaultTitle printString ] 139 ] 140 141 displayOn: aStream [ 142 self displayOn: aStream for: nil 143 ] 144 145 displayOn: aStream for: aSeries [ 146 "#axes #title #with comes first, then rest" 147 148 <category: 'converting'> 149 (self x2 or: [ self y2 ]) 150 ifTrue: [ aStream space; nextPutAll: self axes ]. 151 (title notNil or: [ aSeries notNil ]) 152 ifTrue: [ aStream space; nextPutAll: (self titleFor: aSeries) ]. 153 super displayOn: aStream 154 ] 155 156 title: aTitle [ 157 "A line title for each function and data set appears in the key, accompanied by a sample of the line and/or 158 symbol used to represent it. 159 160 If key autotitles is set (which is the default) and neither title nor notitle are specified the line title is 161 the function name or the file name as it appears on the plot command. If it is a file name, any datafile 162 modifiers specified will be included in the default title. 163 " 164 165 <category: 'title'> 166 "Using printString, i.e. single quotes, to prevent backslash conversion" 167 title := 'title ', aTitle printString 168 ] 169] 170 171Object subclass: GPSeriesGroup [ 172 <category: 'GNUPlot'> 173 <comment: 'I am used internally to track the series that have already 174been plotted in a group.'> 175 176 | id barWidth barOffset dataOffset | 177 = anObject [ 178 <category: 'basic'> 179 ^self class == anObject class and: [ self id = anObject id ] 180 ] 181 182 hash [ 183 <category: 'basic'> 184 ^id hash 185 ] 186 187 id [ 188 <category: 'accessing'> 189 id isNil ifTrue: [ id := 0 ]. 190 ^id 191 ] 192 193 id: anInteger [ 194 <category: 'accessing'> 195 id := anInteger 196 ] 197 198 barWidth [ 199 <category: 'accessing'> 200 barWidth isNil ifTrue: [ barWidth := 0.5 ]. 201 ^barWidth 202 ] 203 204 barWidth: aNumber [ 205 <category: 'accessing'> 206 barWidth := aNumber 207 ] 208 209 barOffset [ 210 <category: 'accessing'> 211 barOffset isNil ifTrue: [ barOffset := 0 ]. 212 ^barOffset 213 ] 214 215 barOffset: aNumber [ 216 <category: 'accessing'> 217 barOffset := aNumber 218 ] 219 220 dataOffset [ 221 <category: 'accessing'> 222 ^dataOffset 223 ] 224 225 stackData: aColumn [ 226 <category: 'accessing'> 227 dataOffset := dataOffset isNil 228 ifTrue: [ aColumn ] 229 ifFalse: [ dataOffset + aColumn ] 230 ] 231] 232 233GPContainer subclass: GPSeries [ 234 <category: 'GNUPlot'> 235 <comment: 'My instances are used to define a plotted function or data set.'> 236 237 GPSeries class >> defaultStyleClass [ 238 ^GPSeriesStyle 239 ] 240 241 addTo: aGPPlot [ 242 <category: 'private - double dispatch'> 243 aGPPlot addSeries: self 244 ] 245 246 defaultTitle [ 247 <category: 'dwim'> 248 self subclassResponsibility 249 ] 250 251 group [ 252 <category: 'accessing'> 253 ^0 254 ] 255 256 group: anInteger [ 257 <category: 'accessing'> 258 "Do nothing. Grouping would not affect the way most data 259 series are drawn." 260 ] 261 262 printDataOn: aStream [ 263 <category: 'printing'> 264 ] 265 266 displayOn: aStream [ 267 <category: 'printing'> 268 | group | 269 group := GPSeriesGroup new id: self group; yourself. 270 self displayOn: aStream group: group. 271 ] 272 273 displayOn: aStream group: aGroup [ 274 <category: 'printing'> 275 self displayStyleOn: aStream group: aGroup 276 ] 277 278 displayStyleOn: aStream group: aGroup [ 279 | theParameters | 280 theParameters := style ifNil: [ self class defaultStyle ]. 281 theParameters displayOn: aStream for: self 282 ] 283 284 displayPrologOn: aStream into: defs [ 285 super displayOn: aStream. 286 ] 287 288 xCoordinateSystem [ 289 <category: 'printing'> 290 ^self style x2 ifTrue: [ 'second' ] ifFalse: [ '' ] 291 ] 292 293 yCoordinateSystem [ 294 <category: 'printing'> 295 self style y2 == self style x2 ifTrue: [ ^'' ]. 296 ^self style y2 ifTrue: [ 'second' ] ifFalse: [ 'first'] 297 ] 298] 299 300 301GPSeries subclass: GPFunctionSeries [ 302 <category: 'GNUPlot'> 303 <comment: 'My instances are used to define a plotted function.'> 304 305 | expression range | 306 GPFunctionSeries class >> on: expr [ 307 <category: 'instance creation'> 308 ^self new expression: expr 309 ] 310 311 defaultTitle [ 312 ^String streamContents: [ :str | expression displayAsOperandOn: str ] 313 ] 314 315 expression [ 316 <category: 'accessing'> 317 ^expression 318 ] 319 320 expression: expr [ 321 <category: 'private - initialization'> 322 expression := expr asGPExpression 323 ] 324 325 from: a to: b [ 326 <category: 'accessing'> 327 range := { a. b } 328 ] 329 330 from [ 331 <category: 'accessing'> 332 ^range ifNotNil: [ :r | r first ] 333 ] 334 335 to [ 336 <category: 'accessing'> 337 ^range ifNotNil: [ :r | r second ] 338 ] 339 340 displayOn: aStream group: aGroup [ 341 <category: 'printing'> 342 range isNil ifFalse: [ 343 aStream 344 nextPut: $[; 345 display: range first; 346 nextPut: $:; 347 display: range second; 348 nextPut: $]; 349 space ]. 350 expression displayOn: aStream. 351 super displayOn: aStream group: aGroup 352 ] 353 354 displayPrologOn: aStream into: defs [ 355 super displayPrologOn: aStream into: defs. 356 expression displayPrologOn: aStream into: defs 357 ] 358] 359 360 361GPSeriesStyle subclass: GPDataSeriesStyle [ 362 <category: 'GNUPlot'> 363 <comment: 'My instances are used to customize the processing of 364a data set before plotting, or its appearance.'> 365 366 smooth: aSymbol [ 367 "aSymbol is any of #unique, #frequency, #csplines, #bezier, #sbezier" 368 369 <category: 'styles'> 370 params at: #smooth put: aSymbol asString 371 ] 372] 373 374GPSeries subclass: GPDataSeries [ 375 <category: 'GNUPlot'> 376 <comment: 'My instances are used to define a plotted data set.'> 377 378 | columns dataSource graphType ticColumns | 379 GPDataSeries class >> defaultStyleClass [ 380 ^GPDataSeriesStyle 381 ] 382 383 GPDataSeries class >> on: aDataSource [ 384 <category: 'instance creation'> 385 ^self new dataSource: aDataSource asGPDataSource 386 ] 387 388 columns [ 389 <category: 'accessing'> 390 columns ifNil: [ ^self defaultColumns ]. 391 ^columns 392 ] 393 394 columns: anArray [ 395 <category: 'private - initialization'> 396 columns := anArray 397 ] 398 399 dataSource [ 400 <category: 'accessing'> 401 ^dataSource 402 ] 403 404 dataSource: aDataSource [ 405 <category: 'private - initialization'> 406 dataSource := aDataSource 407 ] 408 409 defaultColumns [ 410 self subclassResponsibility 411 ] 412 413 defaultTitle [ 414 ^dataSource defaultTitle 415 ] 416 417 graphType: aString [ 418 <category: 'private - initialization'> 419 graphType := aString 420 ] 421 422 displayOn: aStream group: aGroup [ 423 self dataSource displayOn: aStream. 424 aStream nextPutAll: ' using '. 425 self displayColumnsOn: aStream group: aGroup. 426 self displayTicLabelsOn: aStream group: aGroup. 427 super displayOn: aStream group: aGroup. 428 ] 429 430 displayStyleOn: aStream group: aGroup [ 431 graphType isNil ifFalse: [ 432 aStream nextPutAll: ' with '; nextPutAll: graphType; space ]. 433 super displayStyleOn: aStream group: aGroup 434 ] 435 436 displayColumnsOn: aStream group: aGroup [ 437 self columns 438 do: [ :each | each displayOn: aStream ] 439 separatedBy: [ aStream nextPut: $: ]. 440 ] 441 442 displayTicLabelsOn: aStream group: aGroup [ 443 "Add xticlabels etc. fake columns." 444 ticColumns isNil ifFalse: [ 445 ticColumns keysAndValuesDo: [ :k :v | 446 aStream 447 nextPut: $:; 448 nextPutAll: k; 449 nextPut: $(; 450 display: v; 451 nextPut: $) ] ]. 452 ] 453 454 printDataOn: aStream [ 455 dataSource printDataOn: aStream. 456 ] 457 458 displayPrologOn: aStream into: defs [ 459 super displayPrologOn: aStream into: defs. 460 columns isNil ifTrue: [ ^self ]. 461 columns do: [ :each | each displayPrologOn: aStream into: defs ] 462 ] 463 464 ticColumns [ 465 ^ticColumns ifNil: [ ticColumns := LookupTable new ] 466 ] 467 468 xTicColumn [ 469 ^self ticColumns at: 'xtic' ifAbsent: [ nil ] 470 ] 471 472 xTicColumn: column [ 473 ^column isNil 474 ifTrue: [ self ticColumns removeKey: 'xtic' ifAbsent: [ nil ] ] 475 ifFalse: [ self ticColumns at: 'xtic' put: column ] 476 ] 477 478 x2TicColumn [ 479 ^self ticColumns at: 'x2tic' ifAbsent: [ nil ] 480 ] 481 482 x2TicColumn: column [ 483 ^column isNil 484 ifTrue: [ self ticColumns removeKey: 'x2tic' ifAbsent: [ nil ] ] 485 ifFalse: [ self ticColumns at: 'x2tic' put: column ] 486 ] 487 488 yTicColumn [ 489 ^self ticColumns at: 'ytic' ifAbsent: [ nil ] 490 ] 491 492 yTicColumn: column [ 493 ^column isNil 494 ifTrue: [ self ticColumns removeKey: 'ytic' ifAbsent: [ nil ] ] 495 ifFalse: [ self ticColumns at: 'ytic' put: column ] 496 ] 497 498 y2TicColumn [ 499 ^self ticColumns at: 'y2tic' ifAbsent: [ nil ] 500 ] 501 502 y2TicColumn: column [ 503 ^column isNil 504 ifTrue: [ self ticColumns removeKey: 'y2tic' ifAbsent: [ nil ] ] 505 ifFalse: [ self ticColumns at: 'y2tic' put: column ] 506 ] 507 508 "zTicColumn [ 509 ^self ticColumns at: 'ztic' ifAbsent: [ nil ] 510 ] 511 512 zTicColumn: column [ 513 ^column isNil 514 ifTrue: [ self ticColumns removeKey: 'ztic' ifAbsent: [ nil ] ] 515 ifFalse: [ self ticColumns at: 'ztic' put: column ] 516 ]" 517] 518 519GPDataSeries subclass: GPGroupSeries [ 520 <category: 'GNUPlot'> 521 <comment: 'My instances are used to define plotted data sets when 522more series can be grouped together (e.g. in stacked bars).'> 523 524 | group | 525 group [ 526 <category: 'accessing'> 527 group isNil ifTrue: [ group := 0 ]. 528 ^group 529 ] 530 531 group: anInteger [ 532 <category: 'accessing'> 533 group := anInteger. 534 ] 535] 536 537 538GPObject subclass: GPAxis [ 539 <category: 'GNUPlot'> 540 <comment: 'My instances are used to customize the appearance of a plotted 541axis.'> 542 543 | name range logScale mirrorTics outwardTics ticRange ticSpacing ticFormat 544 ticSubdivision majorGrid minorGrid tics style label labelStyle | 545 546 name: aString [ 547 <category: 'private - initialization'> 548 name := aString 549 ] 550 551 withName: aString [ 552 <category: 'private - initialization'> 553 ^name = aString 554 ifTrue: [ self ] 555 ifFalse: [ self copy name: aString ] 556 ] 557 558 from: a to: b [ 559 <category: 'accessing'> 560 range := { a. b } 561 ] 562 563 from [ 564 <category: 'accessing'> 565 ^range ifNotNil: [ :r | r first ] 566 ] 567 568 from: a [ 569 <category: 'accessing'> 570 range := { a. self to } 571 ] 572 573 to [ 574 <category: 'accessing'> 575 ^range ifNotNil: [ :r | r second ] 576 ] 577 578 to: b [ 579 <category: 'accessing'> 580 range := { self from. b } 581 ] 582 583 ticAt: value put: string [ 584 <category: 'accessing'> 585 tics isNil ifTrue: [ tics := OrderedCollection new ]. 586 tics add: value asGPExpression->string 587 ] 588 589 ticFrom: a to: b [ 590 <category: 'accessing'> 591 ticRange := { a. b } 592 ] 593 594 ticFrom [ 595 <category: 'accessing'> 596 ^ticRange ifNotNil: [ :r | r first ] 597 ] 598 599 ticTo [ 600 <category: 'accessing'> 601 ^ticRange ifNotNil: [ :r | r second ] 602 ] 603 604 ticSpacing [ 605 <category: 'accessing'> 606 ^ticSpacing 607 ] 608 609 ticSpacing: aNumber [ 610 <category: 'accessing'> 611 ticSpacing := aNumber 612 ] 613 614 label [ 615 <category: 'accessing'> 616 ^label 617 ] 618 619 label: aString [ 620 <category: 'accessing'> 621 label := aString 622 ] 623 624 labelStyle [ 625 <category: 'accessing'> 626 ^labelStyle 627 ] 628 629 labelStyle: aString [ 630 <category: 'accessing'> 631 labelStyle := aString 632 ] 633 634 ticFormat [ 635 <category: 'accessing'> 636 ^ticFormat 637 ] 638 639 ticFormat: aBoolean [ 640 <category: 'accessing'> 641 ticFormat := aBoolean 642 ] 643 644 ticSubdivision [ 645 <category: 'accessing'> 646 ^ticSubdivision 647 ] 648 649 ticSubdivision: aNumber [ 650 <category: 'accessing'> 651 ticSubdivision := aNumber 652 ] 653 654 majorGrid [ 655 <category: 'accessing'> 656 ^majorGrid 657 ] 658 659 majorGrid: aLineStyle [ 660 <category: 'accessing'> 661 aLineStyle == true ifTrue: [ majorGrid := GPLineStyle new. ^self ]. 662 aLineStyle == false ifTrue: [ majorGrid := nil. ^self ]. 663 majorGrid := aLineStyle 664 ] 665 666 minorGrid [ 667 <category: 'accessing'> 668 ^minorGrid 669 ] 670 671 minorGrid: aLineStyle [ 672 <category: 'accessing'> 673 aLineStyle == true ifTrue: [ minorGrid := GPLineStyle new. ^self ]. 674 aLineStyle == false ifTrue: [ minorGrid := nil. ^self ]. 675 minorGrid := aLineStyle 676 ] 677 678 style [ 679 <category: 'accessing'> 680 ^style 681 ] 682 683 style: aLineStyle [ 684 <category: 'accessing'> 685 aLineStyle == true ifTrue: [ style := GPLineStyle new. ^self ]. 686 aLineStyle == false ifTrue: [ style := nil. ^self ]. 687 style := aLineStyle 688 ] 689 690 initialize [ 691 <category: 'initialization'> 692 super initialize. 693 logScale := false. 694 mirrorTics := true. 695 outwardTics := false. 696 ] 697 698 logScale [ 699 <category: 'accessing'> 700 ^logScale 701 ] 702 703 logScale: aBoolean [ 704 <category: 'accessing'> 705 logScale := aBoolean 706 ] 707 708 mirrorTics [ 709 <category: 'accessing'> 710 ^mirrorTics 711 ] 712 713 mirrorTics: aBoolean [ 714 <category: 'accessing'> 715 mirrorTics := aBoolean 716 ] 717 718 outwardTics [ 719 <category: 'accessing'> 720 ^outwardTics 721 ] 722 723 outwardTics: aBoolean [ 724 <category: 'accessing'> 725 outwardTics := aBoolean 726 ] 727 728 displayGridOn: aStream [ 729 <category: 'printing'> 730 | majGrid | 731 aStream 732 nextPutAll: 'set grid '. 733 minorGrid isNil ifFalse: [ aStream nextPut: $m ]. 734 aStream 735 nextPutAll: name; 736 nextPutAll: 'tics'. 737 738 majGrid := (majorGrid isNil and: [ minorGrid notNil ]) 739 ifTrue: [ minorGrid ] 740 ifFalse: [ majorGrid ]. 741 742 majGrid notNil 743 ifTrue: [ 744 majGrid isDefault 745 ifTrue: [ aStream nextPutAll: ' ls 0' ] 746 ifFalse: [ aStream display: majGrid ] ]. 747 748 minorGrid isNil ifTrue: [ ^self ]. 749 aStream nextPut: $,. 750 minorGrid isDefault 751 ifTrue: [ aStream nextPutAll: ' ls 0' ] 752 ifFalse: [ aStream display: minorGrid ]. 753 ] 754 755 displayRangeOn: aStream [ 756 <category: 'printing'> 757 aStream 758 nextPutAll: 'set '; 759 nextPutAll: name; 760 nextPutAll: 'range ['; 761 display: (range first ifNil: [ '*' ]); 762 nextPut: $:; 763 display: (range second ifNil: [ '*' ]); 764 nextPut: $]; 765 nl 766 ] 767 768 displayTicsOn: aStream [ 769 <category: 'printing'> 770 | spacing | 771 aStream 772 nextPutAll: 'set '; 773 nextPutAll: name; 774 nextPutAll: 'tics'. 775 776 self mirrorTics ifFalse: [ aStream nextPutAll: ' nomirror' ]. 777 self outwardTics ifTrue: [ aStream nextPutAll: ' out' ]. 778 self displayTicRangeOn: aStream. 779 aStream nl 780 ] 781 782 displayTicRangeOn: aStream [ 783 <category: 'printing'> 784 | spacing | 785 ticRange isNil 786 ifTrue: [ 787 (ticSpacing isNil and: [ ticSpacing > 0 ]) 788 ifFalse: [ aStream space; display: ticSpacing ] ] 789 ifFalse: [ 790 spacing := ticSpacing. 791 spacing = 0 ifTrue: [ spacing := self ticTo - self ticFrom ]. 792 spacing isNil ifTrue: [ spacing := (self ticTo - self ticFrom) / 4.0 ]. 793 aStream 794 space; display: self ticFrom; 795 nextPut: $,; display: spacing; 796 nextPut: $,; display: self ticTo ]. 797 ] 798 799 displayUserTicsOn: aStream [ 800 <category: 'printing'> 801 aStream 802 nextPutAll: 'set '; 803 nextPutAll: name; 804 nextPutAll: 'tics add ('. 805 tics 806 do: [ :each | 807 aStream 808 print: each value displayString; 809 space; 810 display: each key ] 811 separatedBy: [ aStream nextPut: $, ]. 812 aStream nextPut: $); nl 813 ] 814 815 displayLabelOn: aStream [ 816 <category: 'printing'> 817 aStream 818 nextPutAll: 'set '; 819 nextPutAll: name; 820 nextPutAll: 'label '; 821 print: label displayString. 822 823 self labelStyle isNil ifFalse: [ 824 aStream display: self labelStyle ]. 825 aStream nl 826 ] 827 828 displayOn: aStream [ 829 <category: 'printing'> 830 | spacing | 831 range isNil ifFalse: [ 832 self displayRangeOn: aStream ]. 833 (ticRange notNil or: [ ticSpacing notNil 834 or: [ self mirrorTics not or: [ self outwardTics ]]]) 835 ifTrue: [ self displayTicsOn: aStream ]. 836 tics notNil 837 ifTrue: [ self displayUserTicsOn: aStream ]. 838 (minorGrid notNil or: [ majorGrid notNil ]) 839 ifTrue: [ self displayGridOn: aStream ]. 840 label notNil 841 ifTrue: [ self displayLabelOn: aStream ]. 842 843 self ticFormat isNil ifFalse: [ 844 aStream 845 nextPutAll: 'set format '; 846 nextPutAll: name; 847 space; 848 print: self ticFormat; 849 nl ]. 850 851 self logScale ifTrue: [ 852 aStream 853 nextPutAll: 'set logscale '; 854 nextPutAll: name; 855 nl ]. 856 857 self style isNil ifFalse: [ 858 aStream 859 nextPutAll: 'set '; 860 nextPutAll: name; 861 nextPutAll: 'zeroaxis'; 862 display: self style; 863 nl ]. 864 865 self ticSubdivision isNil ifFalse: [ 866 aStream 867 nextPutAll: 'set m'; 868 nextPutAll: name; 869 nextPutAll: 'tics '; 870 display: self ticSubdivision; 871 nl ]. 872 ] 873] 874