plotchart arjen markus june 2010. design goals easy to use: just a few commands for a plot wide...
TRANSCRIPT
![Page 1: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/1.jpg)
Plotchart
Arjen Markus
June 2010
![Page 2: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/2.jpg)
Design goals
• Easy to use: just a few commands for a plot
• Wide range of plot and chart types
• Extendable
Its predecessor: emu_graph by Steve
Cassidy
![Page 3: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/3.jpg)
Design decisions
• Use the whole canvas
• Fix the layout
• Simple form of clipping
• Do not manage the data (duplication)
• Changing the appearance takes effect for new data only
![Page 4: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/4.jpg)
Interface
• Create the plot of the chosen type – new command
• Fill in the data via subcommands
• Details differ per plot type
![Page 5: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/5.jpg)
Implementation
Some code – linking method names to
procedures:
set methodProc(xyplot,title) DrawTitle
set methodProc(xyplot,xtext) DrawXtext
set methodProc(xyplot,plot) DrawData
set methodProc(xyplot,dot) DrawDot
set methodProc(xyplot,dotconfig) DotConfigure
set methodProc(xyplot,interval) DrawInterval
set methodProc(xyplot,trend) DrawTrendLine
set methodProc(piechart,plot) DrawPie
set methodProc(piechart,saveplot) SavePlot
![Page 6: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/6.jpg)
Implementation – part 2proc ::Plotchart::createPiechart { w } { variable data_series
foreach s [array names data_series "$w,*"] { unset data_series($s) }
set newchart "piechart_$w" interp alias {} $newchart {} ::Plotchart::PlotHandler piechart $w CopyConfig piechart $w
foreach {pxmin pymin pxmax pymax} [MarginsCircle $w] {break}
viewPort $w $pxmin $pymin $pxmax $pymax $w create oval $pxmin $pymin $pxmax $pymax
SetColours $w blue lightblue green yellow orange red magenta brown DefaultLegend $w DefaultBalloon $w
return $newchart}
![Page 7: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/7.jpg)
Implementation – part 3proc ::Plotchart::PlotHandler { type w command args } { variable methodProc if { [info exists methodProc($type,$command)] } { eval $methodProc($type,$command) $w $args } else { return -code error "No such method - $command“ }}
![Page 8: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/8.jpg)
Implementation: contributions
Many people have contributed with code orsuggestions:Mark Stucky, Stefan Finzel, PaulVogel, Dave Hanks, Michael Baudin,Steve Blinkhorn, …
Jos DeCoster has developed xyplot on topof Plotchart
![Page 9: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/9.jpg)
Currently supported types
• XY-plots (also logarithmic axes)• Contour plots (2D and 3D)• Histograms and piecharts• Time charts and Gantt charts• Radial charts Also: • various types of annotation• Combining plots in one canvas
![Page 10: Plotchart Arjen Markus June 2010. Design goals Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor:](https://reader036.vdocument.in/reader036/viewer/2022082612/56649e385503460f94b2908c/html5/thumbnails/10.jpg)
Demos
• A few examples of Plotchart itself
• Jos DeCoster’s xyplot
• Experimental: SCADA display