Tk Library Source Code
Check-in [d59a943f39]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add support for Taylor diagrams (increase the package's version to 2.5.0)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:d59a943f39f5ec32b743391474905b0e01a643a2f6b08e1001ea493b2f66a231
User & Date: markus 2020-06-01 10:28:09
Context
2020-06-23
09:12
* Changes for the new Tablelist version 6.10. check-in: 2e27116b22 user: csaba tags: trunk
2020-06-01
10:28
Add support for Taylor diagrams (increase the package's version to 2.5.0) check-in: d59a943f39 user: markus tags: trunk
2020-04-21
17:36
* ../../examples/tablelist/*.gif: Removed clsdFolder.gif, openFolder.gif, and file.gif; added (clsd|open)Folder100.gif, (clsd|open)Folder125.gif, ..., (clsd|open)Folder200.gif; added file100.gif, file125.gif, .., file200.gif. check-in: 8fbf7a73f0 user: csaba tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added examples/plotchart/test_taylor.tcl.



























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
#! /bin/sh
# -*- tcl -*- \
exec tclsh "$0" ${1+"$@"}

# test_taylor.tcl --
#     Test the procedures for drawing a Taylor diagram
#
#     See: https://en.wikipedia.org/wiki/Taylor_diagram for a description
#
#     Note:
#     There is a small issue with the margins still to be solved. Use a
#     white background for the canvas to make this invisible.
#
package require Tcl
package require Tk
package require Plotchart
namespace import Plotchart::*

pack [canvas .c]

::Plotchart::plotconfig taylordiagram reference color lime

set p [::Plotchart::createTaylorDiagram .c {10 2.5} -reference 5.4]

$p title "Example of a Taylor diagram"

$p dataconfig data -symbol dot -color blue
$p plot data 4.0 0.9
$p plot data 5.0 0.8

Changes to modules/plotchart/ChangeLog.









1
2
3
4
5
6
7
8
9
10
11
12








2020-02-09  0.7  <andreas_kupries@users.sourceforge.net>

	*
	* Released and tagged Tklib 0.7 ========================
	* 

2018-12-27  Arjen Markus  <arjenmarkus@users,sourceforge.net>
	* plotchart.tcl:  Add missing method definitions for binding events to log(x)-y, x-log(y) and log(x)-log(y) plots,
                   as reported by Alexandru
	* plotbind.tcl:   Apply the patch provided by Alexandru

2017-09-16  Arjen Markus  <arjenmarkus@users,sourceforge.net>
>
>
>
>
>
>
>
>




|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2018-12-27  Arjen Markus  <arjenmarkus@users,sourceforge.net>
	* plotchart.tcl:   Add Taylor diagram as a new diagram type
	* plotchart.man:   Describe Taylor diagrams
	* plotspecial.tcl: Add the method DrawTaylorData
	* plotconfig.tcl:  Add support for Taylor diagrams
	* test_taylor.tcl: Example of drawing a Taylor diagram with some data


2020-02-09  0.7  <andreas_kupries@users.sourceforge.net>

	*
	* Released and tagged Tklib 0.7 ========================
	*

2018-12-27  Arjen Markus  <arjenmarkus@users,sourceforge.net>
	* plotchart.tcl:  Add missing method definitions for binding events to log(x)-y, x-log(y) and log(x)-log(y) plots,
                   as reported by Alexandru
	* plotbind.tcl:   Apply the patch provided by Alexandru

2017-09-16  Arjen Markus  <arjenmarkus@users,sourceforge.net>

Changes to modules/plotchart/pkgIndex.tcl.

1
2
3
4
5
6
7
if {![package vsatisfies [package provide Tcl] 8.5]} {
    # PRAGMA: returnok
    return
}
package ifneeded Plotchart 2.4.1 [list source [file join $dir plotchart.tcl]]
package ifneeded xyplot    1.0.1 [list source [file join $dir xyplot.tcl]]
package ifneeded plotanim    0.2 [list source [file join $dir plotanim.tcl]]




|


1
2
3
4
5
6
7
if {![package vsatisfies [package provide Tcl] 8.5]} {
    # PRAGMA: returnok
    return
}
package ifneeded Plotchart 2.5.0 [list source [file join $dir plotchart.tcl]]
package ifneeded xyplot    1.0.1 [list source [file join $dir xyplot.tcl]]
package ifneeded plotanim    0.2 [list source [file join $dir plotanim.tcl]]

Changes to modules/plotchart/plotchart.man.

1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
....
3774
3775
3776
3777
3778
3779
3780









3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
....
3886
3887
3888
3889
3890
3891
3892




3893
3894
3895
3896
3897
3898
3899
....
3959
3960
3961
3962
3963
3964
3965









































3966
3967
3968
3969
3970
3971
3972
....
4434
4435
4436
4437
4438
4439
4440





4441
4442
4443
4444
4445
4446
4447
[list_end]

[call [cmd \$xyplot] minmax [arg series] [arg xcrd] [arg ymin] [arg ymax]]

Draw a filled strip representing a minimum and a maximum. The configuration of the series influences the polygon as follows:
[term -fillcolour] is used to fill the polygon, [term -colour] is used for the boundary (set it to {} if
no boundary is required and [term -width] determines the width of the boundary.
[para]
The arguments [term ymin] and [term ymax] may be empty to get an extra vertex in the strip. If both
are empty, a new strip is started. For best results, the x-coordinate should be specified in ascending
order.

[list_begin arguments]
[arg_def string series in]
Name of the data series the new min/max strip belongs to.
................................................................................
subcommand however.
[item]
Finally the [emph frame] component uses [emph color], [emph outerwidth]
(for the width of the line surrounding the whole table) and
[emph innerwidth] (for the width of lines separating columns and rows).
[list_end]











[list_begin definitions]
[call [cmd ::Plotchart::eraseplot] [arg anyplot]]

Erase the plot/chart with all resources connected to it.

[list_begin arguments]
[arg_def string anyplot in]
The plot/chart command. All canvas items associated with this command and all
internal resources will be removed, including the plot/chart command itself.
[list_end]

[list_end]
[list_end]

See the examples in plotdemos7.tcl for its use.


[section "SCROLLING FOR TIMECHARTS AND GANTT CHARTS"]

................................................................................
implementations thereof with each other. For more information:
[example {
Desmond Higham and Nicholas Higham
    Matlab Guide
    SIAM, 2005, Philadephia
}]





[list_end]

Most of the general methods for XY-plots work for these plots as well, but their
creation and the methods to plot the data are very specific.

[list_begin definitions]

................................................................................
Plot the data for each given method. The data are identified by the series name and the
appearance is controlled via prior dataconfig subcommand.

[list_begin arguments]
[arg_def list series_and_data_pairs in]
List of series names and data. All data must be given at once.
[list_end]










































[list_end]

The command [term plotmethod] can be used to add new methods for a particular
plot or chart type. It is intended to help you develop specialised graphical displays.

[list_begin definitions]
................................................................................
The text associated with the bars has no tags. The ribbon lines and areas have no tags either.

[para]
[emph "Tables:"]
[para]
Tags used are: frame, cellbg and celltext







[emph "In addition:"]
To implement multiple plots and charts in a single canvas, all items
also get as a tag the plot/chart they belong to. This enables Plotchart
to manipulate only those items.









|







 







>
>
>
>
>
>
>
>
>












<







 







>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>







1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
....
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801

3802
3803
3804
3805
3806
3807
3808
....
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
....
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
....
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
[list_end]

[call [cmd \$xyplot] minmax [arg series] [arg xcrd] [arg ymin] [arg ymax]]

Draw a filled strip representing a minimum and a maximum. The configuration of the series influences the polygon as follows:
[term -fillcolour] is used to fill the polygon, [term -colour] is used for the boundary (set it to {} if
no boundary is required and [term -width] determines the width of the boundary.
[nl]
The arguments [term ymin] and [term ymax] may be empty to get an extra vertex in the strip. If both
are empty, a new strip is started. For best results, the x-coordinate should be specified in ascending
order.

[list_begin arguments]
[arg_def string series in]
Name of the data series the new min/max strip belongs to.
................................................................................
subcommand however.
[item]
Finally the [emph frame] component uses [emph color], [emph outerwidth]
(for the width of the line surrounding the whole table) and
[emph innerwidth] (for the width of lines separating columns and rows).
[list_end]

[item]
The target diagram and the Taylor diagram use the [emph limits] components
in addition to the various general components. The limits component has
one property: the color of the circles and circle segments.
[nl]
For the Taylor diagram you can specify the color of the reference circles
via the [emph reference] component.
[list_end]


[list_begin definitions]
[call [cmd ::Plotchart::eraseplot] [arg anyplot]]

Erase the plot/chart with all resources connected to it.

[list_begin arguments]
[arg_def string anyplot in]
The plot/chart command. All canvas items associated with this command and all
internal resources will be removed, including the plot/chart command itself.
[list_end]


[list_end]

See the examples in plotdemos7.tcl for its use.


[section "SCROLLING FOR TIMECHARTS AND GANTT CHARTS"]

................................................................................
implementations thereof with each other. For more information:
[example {
Desmond Higham and Nicholas Higham
    Matlab Guide
    SIAM, 2005, Philadephia
}]

[item]
Taylor diagrams are another graphical representation of how numerical models reproduce
measurement data. A detailed description appears in [uri https://en.wikipedia.org/wiki/Taylor_diagram]

[list_end]

Most of the general methods for XY-plots work for these plots as well, but their
creation and the methods to plot the data are very specific.

[list_begin definitions]

................................................................................
Plot the data for each given method. The data are identified by the series name and the
appearance is controlled via prior dataconfig subcommand.

[list_begin arguments]
[arg_def list series_and_data_pairs in]
List of series names and data. All data must be given at once.
[list_end]

[call [cmd ::Plotchart::createTaylorDiagram] [arg w] [arg radius_data] [arg args]]

Create a new Taylor diagram (one quadrant) with circles indicating the distance to the reference point.
[para]
The data points are given as the standard deviation and the correlation to the reference.

[list_begin arguments]
[arg_def widget w in]
Name of the [emph existing] canvas widget to hold the plot.

[arg_def list radius_data in]
A list of the maximum radius for the standard deviation and the step size. Quarter circles are
drawn with the axis labels.
[list_end]
[para]

Currently one option is supported:
[list_begin options]
[opt_def reference value]
Reference value for the data points to be compared with. It appears as a dot at the x-axis.
Along with this dot circle segments are drawn at the same spacing as the axis labels to indicate
the distance of the data points from the reference.
[list_end]

[call [cmd \$taylor] plot [arg series] [arg stdev] [arg corr]]
The plot method takes the standard deviation and the correlation to the reference as input
and draws a symbol as a representation. The standard deviation serves as the distance from the
origin and the correlation determines the angle.

[list_begin arguments]
[arg_def string series in]
Name of the series (it will be plotted as a symbol that is configured via the
[emph {$target dataconfig}] command (see the XY-plot equivalent for an explanation)

[arg_def float stdev in]
Standard deviation of the data point

[arg_def list corr in]
Correlation coefficient with the reference dataset
[list_end]

[list_end]

The command [term plotmethod] can be used to add new methods for a particular
plot or chart type. It is intended to help you develop specialised graphical displays.

[list_begin definitions]
................................................................................
The text associated with the bars has no tags. The ribbon lines and areas have no tags either.

[para]
[emph "Tables:"]
[para]
Tags used are: frame, cellbg and celltext

[para]
[emph "Special plot types (target diagrams, Taylor diagrams:"]
[para]
Tags used are: limits, limit_labels, reference


[emph "In addition:"]
To implement multiple plots and charts in a single canvas, all items
also get as a tag the plot/chart they belong to. This enables Plotchart
to manipulate only those items.


Changes to modules/plotchart/plotchart.tcl.

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
529
530
531
532
533
534
535





















536
537
538
539
540
541
542
....
2854
2855
2856
2857
2858
2859
2860










































































































































2861
2862
2863
2864
2865
2866
2867
....
3139
3140
3141
3142
3143
3144
3145
3146
                    createIsometricPlot create3DPlot \
                    createGanttChart createHistogram colorMap \
                    create3DBars createRadialchart \
                    createTXPlot createRightAxis \
                    create3DRibbonChart create3DRibbonPlot \
                    createXLogYPlot createLogXYPlot createLogXLogYPlot \
                    createWindrose createTargetDiagram createPerformanceProfile \
                    createTableChart createTitleBar \
                    createSpiralPie createTernaryDiagram createStatusTimeline \
                    plotstyle plotconfig plotpack plotmethod clearcanvas eraseplot

   #
   # Array linking procedures with methods
   #
   set methodProc(xyplot,title)             DrawTitle
................................................................................
   set methodProc(targetdiagram,balloon)       DrawBalloon
   set methodProc(targetdiagram,balloonconfig) ConfigBalloon
   set methodProc(targetdiagram,plaintext)     DrawPlainText
   set methodProc(targetdiagram,plaintextconfig) ConfigPlainText
   set methodProc(targetdiagram,dataconfig)    DataConfig
   set methodProc(targetdiagram,canvas)        GetCanvas
   set methodProc(targetdiagram,deletedata)    DeleteData





















   set methodProc(3dribbonplot,title)          DrawTitle
   set methodProc(3dribbonplot,subtitle)       DrawSubtitle
   set methodProc(3dribbonplot,plot)           Draw3DRibbon
   set methodProc(3dribbonplot,saveplot)       SavePlot
   set methodProc(3dribbonplot,xconfig)        XConfig
   set methodProc(3dribbonplot,yconfig)        YConfig
   set methodProc(3dribbonplot,zconfig)        ZConfig
................................................................................
    #
    # Take care of the compatibility for coordsToPixel and friends
    #
    CopyScalingData $w $c

    return $newchart
}











































































































































# createPerformanceProfile --
#    Create a command for drawing a performance profile
# Arguments:
#    c           Name of the canvas
#    scale       Maximum value for the x-axis
#    args        Optional arguments (-box etc.)
................................................................................
source [file join [file dirname [info script]] "plotspecial.tcl"]
source [file join [file dirname [info script]] "plotobject.tcl"]
source [file join [file dirname [info script]] "plottable.tcl"]
source [file join [file dirname [info script]] "plotstatustimeline.tcl"]

# Announce our presence
#
package provide Plotchart 2.4.1







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
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
....
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
....
3298
3299
3300
3301
3302
3303
3304
3305
                    createIsometricPlot create3DPlot \
                    createGanttChart createHistogram colorMap \
                    create3DBars createRadialchart \
                    createTXPlot createRightAxis \
                    create3DRibbonChart create3DRibbonPlot \
                    createXLogYPlot createLogXYPlot createLogXLogYPlot \
                    createWindrose createTargetDiagram createPerformanceProfile \
                    createTableChart createTitleBar createTaylorDiagram \
                    createSpiralPie createTernaryDiagram createStatusTimeline \
                    plotstyle plotconfig plotpack plotmethod clearcanvas eraseplot

   #
   # Array linking procedures with methods
   #
   set methodProc(xyplot,title)             DrawTitle
................................................................................
   set methodProc(targetdiagram,balloon)       DrawBalloon
   set methodProc(targetdiagram,balloonconfig) ConfigBalloon
   set methodProc(targetdiagram,plaintext)     DrawPlainText
   set methodProc(targetdiagram,plaintextconfig) ConfigPlainText
   set methodProc(targetdiagram,dataconfig)    DataConfig
   set methodProc(targetdiagram,canvas)        GetCanvas
   set methodProc(targetdiagram,deletedata)    DeleteData
   set methodProc(taylordiagram,title)         DrawTitle
   set methodProc(taylordiagram,subtitle)      DrawSubtitle
   set methodProc(taylordiagram,xtext)         DrawXtext
   set methodProc(taylordiagram,xsubtext)      DrawXsubtext
   set methodProc(taylordiagram,ytext)         DrawYtext
   set methodProc(taylordiagram,ysubtext)      DrawYsubtext
   set methodProc(taylordiagram,vtext)         DrawVtext
   set methodProc(taylordiagram,vsubtext)      DrawVsubtext
   set methodProc(taylordiagram,plot)          DrawTaylorData
   set methodProc(taylordiagram,saveplot)      SavePlot
   set methodProc(taylordiagram,background)    BackgroundColour
   set methodProc(taylordiagram,legendconfig)  LegendConfigure
   set methodProc(taylordiagram,legend)        DrawLegend
   set methodProc(taylordiagram,removefromlegend) RemoveFromLegend
   set methodProc(taylordiagram,balloon)       DrawBalloon
   set methodProc(taylordiagram,balloonconfig) ConfigBalloon
   set methodProc(taylordiagram,plaintext)     DrawPlainText
   set methodProc(taylordiagram,plaintextconfig) ConfigPlainText
   set methodProc(taylordiagram,dataconfig)    DataConfig
   set methodProc(taylordiagram,canvas)        GetCanvas
   set methodProc(taylordiagram,deletedata)    DeleteData
   set methodProc(3dribbonplot,title)          DrawTitle
   set methodProc(3dribbonplot,subtitle)       DrawSubtitle
   set methodProc(3dribbonplot,plot)           Draw3DRibbon
   set methodProc(3dribbonplot,saveplot)       SavePlot
   set methodProc(3dribbonplot,xconfig)        XConfig
   set methodProc(3dribbonplot,yconfig)        YConfig
   set methodProc(3dribbonplot,zconfig)        ZConfig
................................................................................
    #
    # Take care of the compatibility for coordsToPixel and friends
    #
    CopyScalingData $w $c

    return $newchart
}

# createTaylorDiagram --
#    Create a command for drawing a taylor diagram
# Arguments:
#    c            Name of the canvas
#    radius_data  Maximum radius and step
#    args         Optional arguments (-box etc.)
#                 Specific option:
#                 -reference value  Draw the refence circles around this point
# Result:
#    Name of a new command
# Note:
#    By default the entire canvas will be dedicated to the Taylor diagram.
#    The plot will be drawn with axes
#
proc ::Plotchart::createTaylorDiagram { c radius_data args} {
    variable scaling
    variable data_series
    variable config

    set w [NewPlotInCanvas $c]
    interp alias {} $w {} $c

    ClearPlot $w

    set newchart "taylordiagram_$w"
    interp alias {} $newchart {} ::Plotchart::PlotHandler taylordiagram $w
    CopyConfig taylordiagram $w

    foreach {pxmin pymin pxmax pymax} [MarginsSquare $w] {break}

    set scaling($w,coordSystem) 0

    foreach {xmin xmax xdelt} [concat 0.0 $radius_data] {break}
    foreach {ymin ymax ydelt} [concat 0.0 $radius_data] {break}

    if { $xdelt == 0.0 || $ydelt == 0.0 } {
        return -code error "Step size can not be zero"
    }

    set xdelt [expr {abs($xdelt)}]
    set ydelt [expr {abs($ydelt)}]

    viewPort         $w $pxmin $pymin $pxmax $pymax
    worldCoordinates $w $xmin  $ymin  $xmax  $ymax

    DrawYaxis        $w $ymin  $ymax  $ydelt
    DrawXaxis        $w $xmin  $xmax  $xdelt

    DrawMask         $w
    DefaultLegend    $w
    DefaultBalloon   $w

    #
    # Circles for standard deviation
    #

    set r $xdelt
    while { $r < $xmax + 0.5*$xdelt } {
        foreach {pxmin pymin} [coordsToPixel $w [expr {-$r}] [expr {-$r}]] {break}
        foreach {pxmax pymax} [coordsToPixel $w $r $r] {break}

        $w create arc $pxmin $pymin $pxmax $pymax -outline $config($w,limits,color) -tag limits -start 0 -extent 90 -style arc -outline $config($w,limits,color)

        set r [expr {$r + $xdelt}]
    }
    set radmax [expr {$r - $xdelt}]

    #
    # Reference circles
    #
    set hasref 0
    foreach {key value} $args {
        if { $key eq "-reference" } {
            set refvalue $value
            set hasref   1
            break
        }
    }

    if { $hasref} {
        set r         $xdelt
        while { $r <= $xmax + 0.5*$xdelt } {
            set refstart  0
            set refextent 180

            foreach {pxmin pymin} [coordsToPixel $w [expr {$refvalue-$r}] [expr {-$r}]] {break}
            foreach {pxmax pymax} [coordsToPixel $w [expr {$refvalue+$r}] [expr {+$r}]] {break}

            # Cut-off on the right side ...
            if { $refvalue > 0.0 } {

                set xright [expr {($radmax**2 + $refvalue**2 - $r**2) / (2.0 * $refvalue)}]

                if { $xright < $radmax } {
                    set yright    [expr {sqrt($radmax**2 - $xright**2)}]
                    set refstart  [expr {180.0/acos(-1.0) * atan2($yright,$xright-$refvalue)}]
                    set refextent [expr {$refextent - $refstart}]
                }
                puts "$xright -- $radmax -- $refstart -- $refextent"
            }

            $w create arc $pxmin $pymin $pxmax $pymax  -tag reference -start $refstart -extent $refextent -style arc -outline $config($w,reference,color)

            set r [expr {$r + $xdelt}]
        }

        DataConfig     $w reference -type symbol -symbol dot -color $config($w,reference,color)
        DrawTaylorData $w reference $refvalue 1.0
    }

    #
    # Spokes for correlation
    #
    foreach {pxmin pymin} [coordsToPixel $w 0.0 0.0] {break}

    foreach corr {0.1 0.3 0.5 0.7 0.9 0.98} {
        set angle [expr {acos($corr)}]
        set xend  [expr {$radmax * cos($angle)}]
        set yend  [expr {$radmax * sin($angle)}]

        foreach {pxmax pymax} [coordsToPixel $w $xend $yend] {break}

        $w create text $pxmax $pymax -tag "limit limit_labels" -text " $corr" -anchor sw -fill $config($w,limits,color)
        $w create line $pxmin $pymin $pxmax $pymax -tag limits -fill $config($w,limits,color)
    }

    #
    # Take care of the compatibility for coordsToPixel and friends
    #
    CopyScalingData $w $c

    .c lower limits
    .c raise limit_labels
    .c lower reference

    return $newchart
}

# createPerformanceProfile --
#    Create a command for drawing a performance profile
# Arguments:
#    c           Name of the canvas
#    scale       Maximum value for the x-axis
#    args        Optional arguments (-box etc.)
................................................................................
source [file join [file dirname [info script]] "plotspecial.tcl"]
source [file join [file dirname [info script]] "plotobject.tcl"]
source [file join [file dirname [info script]] "plottable.tcl"]
source [file join [file dirname [info script]] "plotstatustimeline.tcl"]

# Announce our presence
#
package provide Plotchart 2.5.0

Changes to modules/plotchart/plotconfig.tcl.

133
134
135
136
137
138
139

140
141
142
143
144
145
146
...
163
164
165
166
167
168
169

170
171
172
173
174
175
176
...
188
189
190
191
192
193
194

195
196
197
198
199
200
201
...
286
287
288
289
290
291
292


293
294
295
296
297
298
299
    set config(charttypes) {
        xyplot xlogyplot logxyplot logxlogyplot
        piechart spiralpie polarplot
        histogram horizbars vertbars ganttchart
        timechart stripchart isometric 3dplot 3dbars
        radialchart txplot 3dribbon boxplot windrose
        targetdiagram performance table ternary distnormal

    }

    # define implemented components for each chart type:
    foreach {type components} {
        xyplot        {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}
        xlogyplot     {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}
        logxyplot     {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}
................................................................................
        boxplot       {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask bar}
        windrose      {title subtitle margin text legend axis                          background}
        targetdiagram {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask limits}
        performance   {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask limits}
        table         {title subtitle margin background header oddrow evenrow cell frame leftaxis rightaxis bottomaxis}
        ternary       {title subtitle margin text legend axis leftaxis rightaxis bottomaxis background mask}
        distnormal    {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}

    } {
        set config($type,components) $components
    }

    # Note on the table components: The axes are dummy components!

    # define implemented properties for each component:
................................................................................
        title      {textcolor font anchor background}
        subtitle   {textcolor font anchor background}
        text        -
        labels     {textcolor font placement sorted shownumbers format formatright}
        background {outercolor innercolor}
        legend     {background border position}
        limits     {color}

        bar        {barwidth innermargin outline}
        mask       {draw}
        header     {background font color height anchor}
        oddrow     {background font color height anchor}
        evenrow    {background font color height anchor}
        cell       {background font color anchor leftspace rightspace topspace}
        frame      {color outerwidth innerwidth}
................................................................................
        #
        plotstyle configure "default" $type title background ""
    }
    #
    # Specific defaults
    #
    plotstyle configure "default" targetdiagram limits color "gray"


    plotstyle configure "default" table margin left 30 right 30
    plotstyle configure "default" piechart  labels shownumbers 0
    plotstyle configure "default" piechart  labels format      "%s (%g)"
    plotstyle configure "default" spiralpie labels shownumbers 0
    plotstyle configure "default" spiralpie labels format      "%s (%g)"
    plotstyle configure "default" polarplot axis   color       "gray"








>







 







>







 







>







 







>
>







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
...
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
...
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
...
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
    set config(charttypes) {
        xyplot xlogyplot logxyplot logxlogyplot
        piechart spiralpie polarplot
        histogram horizbars vertbars ganttchart
        timechart stripchart isometric 3dplot 3dbars
        radialchart txplot 3dribbon boxplot windrose
        targetdiagram performance table ternary distnormal
        taylordiagram
    }

    # define implemented components for each chart type:
    foreach {type components} {
        xyplot        {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}
        xlogyplot     {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}
        logxyplot     {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}
................................................................................
        boxplot       {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask bar}
        windrose      {title subtitle margin text legend axis                          background}
        targetdiagram {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask limits}
        performance   {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask limits}
        table         {title subtitle margin background header oddrow evenrow cell frame leftaxis rightaxis bottomaxis}
        ternary       {title subtitle margin text legend axis leftaxis rightaxis bottomaxis background mask}
        distnormal    {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask}
        taylordiagram {title subtitle margin text legend leftaxis rightaxis bottomaxis background mask limits reference}
    } {
        set config($type,components) $components
    }

    # Note on the table components: The axes are dummy components!

    # define implemented properties for each component:
................................................................................
        title      {textcolor font anchor background}
        subtitle   {textcolor font anchor background}
        text        -
        labels     {textcolor font placement sorted shownumbers format formatright}
        background {outercolor innercolor}
        legend     {background border position}
        limits     {color}
        reference  {color}
        bar        {barwidth innermargin outline}
        mask       {draw}
        header     {background font color height anchor}
        oddrow     {background font color height anchor}
        evenrow    {background font color height anchor}
        cell       {background font color anchor leftspace rightspace topspace}
        frame      {color outerwidth innerwidth}
................................................................................
        #
        plotstyle configure "default" $type title background ""
    }
    #
    # Specific defaults
    #
    plotstyle configure "default" targetdiagram limits color "gray"
    plotstyle configure "default" taylordiagram limits color "gray"
    plotstyle configure "default" taylordiagram reference color "black"
    plotstyle configure "default" table margin left 30 right 30
    plotstyle configure "default" piechart  labels shownumbers 0
    plotstyle configure "default" piechart  labels format      "%s (%g)"
    plotstyle configure "default" spiralpie labels shownumbers 0
    plotstyle configure "default" spiralpie labels format      "%s (%g)"
    plotstyle configure "default" polarplot axis   color       "gray"

Changes to modules/plotchart/plotspecial.tcl.

72
73
74
75
76
77
78
























79
80
81
82
83
84
85
    set bstar  [expr {($xmean-$ymean) / $stdevy}]
    set sstar2 [expr {$sumx2 / $sumy2}]
    set rmsd   [expr {sqrt(1.0 + $sstar2 - 2.0 * sqrt($sstar2) * $corrxy)}]

    DataConfig $w $series -type symbol
    DrawData $w $series $rmsd $bstar
}

























# DrawPerformanceData --
#    Compute the coordinates for the performance profiles and draw the lines
#
# Arguments:
#    w                  Name of the canvas
#    profiledata        Names and data for each profiled item







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
    set bstar  [expr {($xmean-$ymean) / $stdevy}]
    set sstar2 [expr {$sumx2 / $sumy2}]
    set rmsd   [expr {sqrt(1.0 + $sstar2 - 2.0 * sqrt($sstar2) * $corrxy)}]

    DataConfig $w $series -type symbol
    DrawData $w $series $rmsd $bstar
}

# DrawTaylorData --
#    Compute the coordinates for the symbol in a Taylor diagram and draw it
#
# Arguments:
#    w           Name of the canvas
#    series      Name of the series of symbols
#    stdev       Standard deviation
#    corr        Correlation
# Result:
#    None
#
# Side effects:
#    Symbol drawn
#
proc ::Plotchart::DrawTaylorData { w series stdev corr } {

    set angle [expr {acos($corr)}]
    set xdata [expr {$stdev * cos($angle)}]
    set ydata [expr {$stdev * sin($angle)}]

    DataConfig $w $series -type symbol
    DrawData $w $series $xdata $ydata
}

# DrawPerformanceData --
#    Compute the coordinates for the performance profiles and draw the lines
#
# Arguments:
#    w                  Name of the canvas
#    profiledata        Names and data for each profiled item