Version 10 of Plotchart gallery

Updated 2007-05-30 10:11:35 by arjen

Arjen Markus (30 may 2007)

For testing and exhibiting the features of Plotchart, I have a small set of programs. They are all part of the CVS repository, so for the most recent versions, I will refer you to the Tklib project.

For the moment, I have not included all the code here (just laziness and lack of time), but perhaps I will do so later.


Gallery of Plotchart features

Not all features are shown yet:

  • Stripcharts and isometric plots are missing
  • Grid lines (ticklines)
  • Legends
  • Numerous options (like background colours)

Example of how to create one of the pictures:

 #
 # Create the canvas widget and the XY plot
 # (the right axis derives certain properties from the original plot!)
 #
 # Important:
 # Set the extremes for the axis
 #
 canvas .c  -background white -width 400 -height 200
 pack .c -fill both

 set s [::Plotchart::createXYPlot .c {0.0 100.0 10.0} {0.0 100.0 20.0}]
 set r [::Plotchart::createRightAxis .c {0.0 0.1 0.01}]

 #
 # Add the data to the plot
 #
 set xd    5.0
 set yd   20.0
 set xold  0.0
 set yold 50.0

 $s dataconfig series1 -colour "red"
 $s dataconfig series2 -colour "blue"
 $s dataconfig series3 -colour "magenta"

 for { set i 0 } { $i < 20 } { incr i } {
    set xnew [expr {$xold+$xd}]
    set ynew [expr {$yold+(rand()-0.5)*$yd}]
    set ynew2 [expr {$yold+(rand()-0.5)*2.0*$yd}]
    $s plot series1 $xnew $ynew
    $s plot series2 $xnew $ynew2
    $s trend series3 $xnew $ynew2
    set xold $xnew
    set yold $ynew
 }

 #
 # Some "intervals" and other things to show that Plotchart can
 # do that too
 #
 $s interval series2 50.0 40.0 60.0 52.0
 $s interval series2 60.0 40.0 60.0

 $s xtext "X-coordinate"
 $s ytext "Y-data"
 $r ytext "Right axis"
 $s title "Aha!"

 #
 # Some data for the right axis
 #
 $r dataconfig right -type both -symbol circle -colour green
 $r plot right 10.0 0.01
 $r plot right 30.0 0.03
 $r plot right 40.0 0.02

 #
 # Save the picture
 #
 tkwait visibility .c
 $s saveplot "aha.ps"

XY-plots, polar plot and piechart

http://tclerswiki.googlepages.com/xyplot.jpg

http://tclerswiki.googlepages.com/symbols.jpg

Histogram and R-chart

http://tclerswiki.googlepages.com/histogram.jpg

http://tclerswiki.googlepages.com/rchart.jpg

Barcharts

http://tclerswiki.googlepages.com/vertbars.jpg

http://tclerswiki.googlepages.com/horizbars.jpg

http://tclerswiki.googlepages.com/3dbars.jpg

Gantt chart

http://tclerswiki.googlepages.com/gantt.JPG

Radial charts

http://tclerswiki.googlepages.com/radial.jpg

Contour lines and filled contours

http://tclerswiki.googlepages.com/contour1.jpg

http://tclerswiki.googlepages.com/contour2.jpg

http://tclerswiki.googlepages.com/contour3.jpg

http://tclerswiki.googlepages.com/hotcolours.jpg

http://tclerswiki.googlepages.com/coolcolours.jpg

http://tclerswiki.googlepages.com/gray_jet_lines.jpg

3D Plots

http://tclerswiki.googlepages.com/3dplots.jpg

http://tclerswiki.googlepages.com/3dcontour.jpg

Vectors and dots

http://tclerswiki.googlepages.com/arrows_dots.jpg

http://tclerswiki.googlepages.com/dipole.jpg


[ Category Graphics

Category Plotting

]