See [Plots and charts] for further information. This package was and is written by [AM]. Documentation can be found at * http://tcllib.sourceforge.net/doc/plotchart.html * http://docs.activestate.com/activetcl/8.5/tklib/plotchart/plotchart.html A part of [tklib], a set of [tk]-related extension/widgets. See some examples at [Plotchart gallery]. The humble beginnings of a tutorial can be found at: [An interactive tutorial for Plotchart] ---- [Bryan Oakley] 09-May-2005 I notice that the code uses [[$w cget -width]] everywhere it needs a value to compute the width of the graph. My first thought was that this seemed wrong -- it ought to use [[winfo width $w]] so that it will be drawn to fit the window in case the window grows because of the way it is packed/gridded. Of course, this also means the graph will shrink if the viewable portion of the canvas is less than the configured width/height of the canvas. I can see a case for each behavior, so I'm wondering if it would be useful to have a configuration option such that one could do ''$plot configure -width "actual"'' or ''... -width "request"''. Of course, I can simulate that by adding code to do something like [[.canvas configure -width [[winfo width .canvas]] after I pack/grid it, but I'm not fond of that solution. [JE] What are the cases for the current behavior? It seems to me that the actual width is always the right thing to use, I can't think of when you'd want it to use the requested width (if the two differ). A third option might be to specify an actual value, e.g. ''$plot configure -width 200'' for the case where you have a really large plot that you want to scroll around in a small canvas. I'd be willing to contribute the code for this option if you think it would be useful. [AM] (10 may 2005) I have not given much thought to this issue, I must admit. Resizing the plot's canvas may have to result in one of several things: * The plot is redrawn to fit the new size (using the new width and height) * The plot is redrawn to fit the new size but the ratio width/height remains the same * The plot remains as it is (for instance to enable scrolling ...) I can see all of these happening - should there be an option for dealing with this? Code contributions are welcomed of course. [PWE] 20070806 Now I've started using plotchart, some comments/questions on the xy-plots. 1) If the title of the chart is long, it overwrites the text of the Y axis. 2) Is it possible to have a custom format for the X or Y axis labels. For instance when the X axis is time, to have the labels display dates? Something like blt's axis configure myaxis -command myformat 3) Is it possible to have multiple charts on a single canvas? So one can make a report with multiple graphs, and print it on a single sheet of paper? [AM] (22 november 2007) Sorry for noticing these questions so late: 1. I will have to look into that one. Note that you can use \n to break the title in separate lines 1. Yes: $plot xformat "%e12.4 " for instance (IIRC, I should check the code and the docs, but the functionality should be there!) 1. When I used its predecessor, emu_graph, I needed to plot multiple charts too. This turned out to be somewhat tricky, as things in one chart, started to interfer with the other. When I wrote Plotchart using my knowledge of and experience with emu_graph, I decided to use one canvas per chart for that reason and because I could implement a kind of clipping more easily that way (I use filled rectangles for that). That means the basic design does not allow for more than one chart per canvas. However, when you use a cloning technique (and have no fear for data outside the shown region), it may very well be possible to copy the contents of several canvases into a single canvas for printing. ---- [AM] (123 november 2007) I have been experimenting with adding interactive features to Plotchart, but you can use the current version in an interactive environment already: [Use an xy-plot to edit data series] ---- [JHJL] (2 Dec 2007) Got the latest sources from CVS but ran into a couple of problems: 1. The pkgIndex is out of synch (states 1.3.1, should be 1.4.0) 1. There are some debug lines in the plotaxis.tcl (two puts and a console show) Can anyone explain how to plot data on the isometric plot - I see code to draw circles and rectangles but can't get ordinary x,y data points to plot. And as a bonus, how does one draw gridlines on an XY plot (or isometric plot)? All help gratefully received! [AM] (4 december 2007) I will have to look into your questions about pkgIndex.tcl and plotaxis.tcl - thanks for noting these. I intended isometric plots as a way to easily draw scale models or simple geographic plots. What kind of representation would you like for x,y data points? If it is dots, then small circles ought to do (the canvas does not support "real" dots, i.e. individual pixels). Xy-plots have methods to draw grid-lines: $p xticklines $p yticklines draw vertical and horizontal lines, corresponding to the labels along the x and y axes, respectively. If you are missing something from the user documentation, please let me know. [JHJL] Thanks Arjen, Plotchart is a very nice library to have to hand. I plot a lot of X,Y positional data (e.g. aircraft, ships etc) and therefore need to keep the grid square. I had hoped the isometric plot would help here... I will look into your suggestions for drawing the grid lines (would be nice as an axis option though :) [AM] Ah, now I understand - well, I might be able to help out with that :). I need to do some work on Plotchart anyway and this should be easy enough (just need a clear idea on what needs to be done). ---- [AM] (20 august 2008) When you have many items for a time chart or a Gantt chart, being able to scroll up and down is useful. But the title must remain visible, as well as the time axis ... So here is a small experiment: [Experimenting with canvas and scrollbar] ---- [AM] Here is code for [Drawing a wind rose] ---- '''[VL] - 2010-01-21 05:07:41''' ---- !!!!!! %|[Category Command] | [Category GUI] | [Category Plotting]|% !!!!!!