"Fossies" - the Fresh Open Source Software Archive

Member "plplot-5.15.0/FAQ" (1 Jun 2019, 80718 Bytes) of package /linux/misc/plplot-5.15.0.tar.gz:

As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "FAQ": 5.13.0_vs_5.14.0.

    2 This is a rather old FAQ, but start looking for your questions here, anyway.
    4 PLplot FAQ (Frequently Asked Questions)
    5 ---------------------------------------
    7 This note contains answers to some Frequently Asked Questions (FAQ)
    8 regarding PLplot.
   10 Disclaimer:
   12 The questions & answers that follow typically have been posed (and answered)
   13 in email, and seem to me to be worthy of inclusion in a FAQ.  They may be
   14 out of date with respect to the current revision, or be otherwise suspect
   15 (misleading, incomplete, etc.), and the original authors of both the
   16 question and answer have not been retained (most of the answers come from
   17 Maurice, some from Geoff, and the rest from various people on the mailing
   18 list).  Personal opinions may be contained within: this document is not to
   19 be considered the official opinion of the IFS or University of Texas or any
   20 other funding agency supporting this work.  Feel free to send comments or
   21 corrections to mjl@dino.ph.utexas.edu (Maurice LeBrun) or
   22 furnish@dino.ph.utexas.edu (Geoff Furnish).
   24 The conventions of the CVS FAQ are adopted here.  Each question in the
   25 table of contents will be given a change marker (for non-trivial changes)
   26 in the first column:
   28 	'-'	for a Question that has changed.
   29 	'='	for an Answer that has changed.
   30 	'#'	for an entry with changes to both Question and Answer.
   31 	'+'	for a newly added Question and Answer.
   33 ==============================================================================
   34 Contents
   35 --------
   37  1. Building/installing PLplot
   38  2. Philosophy, future directions, broad capabilities, etc.
   39  3. Specific features/capabilities
   40  4. X-based drivers (includes Tcl/TK, Tcl-DP)
   41  5. All other drivers & supported platforms
   43 ==============================================================================
   44 Section 1: Building/installing PLplot
   46  1.1  How do I build & install PLplot?
   47  1.2  Where do I install PLplot?
   48  1.3  (moved)
   49  1.4  I don't have an ANSI compiliant C compiler.  How do I compile PLplot?
   50  1.5  I don't have a fortran compiler; how do I compile PLplot?
   51  1.6  The linker complains of unresolved functions atexit(), fsetpos(),
   52       fgetpos(), and so on.
   53  1.7  The compiler complains about the use of "malloc" or "size_t".
   54 =1.8  The compiler complains about "caddr_t" in one of the X support files.
   55  1.9  configure script doesn't run correctly
   56  1.10 (removed)
   57  1.11 The linker complains that it can't resolve Tcl_AppInit.
   58 +1.12 Can the library place be changed *after* compilation, say, by an
   59       environment variable ?
   60 +1.13 tcpip.c won't compile.
   62 ==============================================================================
   63 Section 2: Philosophy, future directions, broad capabilities, etc.
   65  2.1  Why should I use PLplot?
   66 +2.2  Could you comment on the pros and cons of plplot and gnuplot?
   67 +2.3  How do I use PLplot to do interactive plotting?
   68 +2.4  What is RLaB?
   69 +2.5  Why should I use Tcl?
   70 +2.6  What are some of the planned enhancements to the PLplot interactive
   71       capabilities?
   72 +2.7  Is there a PLplot newsgroup?
   74 ==============================================================================
   75 Section 3: Specific features/capabilities
   77  3.1  The manual doesn't mention capability...
   78 =3.2  How do I change the default background color?
   79  3.3  I'm getting core dumps when calling a contour function from C.
   80  3.4  Changing the default line width doesn't have any affect.
   81  3.5  How can I generate more than 16 line colors?
   82  3.6  What 2-d array organization am I supposed to use from C?
   83  3.7  On stretched windows, the string characters look bad..
   84  3.8  I would like to capture key sequences..
   85 -3.9  How to get more information about a function or capability.
   86 +3.10 What are the keyboard controls in the graphics window?
   87 +3.11 How do I get the value of a PLplot internal variable?
   88 +3.12 I'm getting "Unable to delete command .dx.gq1" when I use a matrix.
   89 +3.13 My matrix'es are being deleted while in use from itcl.
   90 +3.14 I'm getting a "already exists" message when creating a tclMatrix.
   92 ==============================================================================
   93 Section 4: X-based drivers (includes Tcl/TK, Tcl-DP)
   95 =4.1  Where do I get Tcl/TK or Tcl-DP?
   96  4.2  How do I use "xauth"?
   97  4.3  How do I use the Tcl/TK driver?
   98  4.4  I've been having trouble getting the TK/TCL and PLplot working on...
   99  4.5  I would like to issue a plot command, have the window appear,...
  100  4.6  The X driver seems to run slower than on older versions of PLplot.
  101  4.7  How do I change the title on the TK window menu bar, i.e...
  102 -4.8  How do I run plserver as a daemon?
  103  4.9  Problems printing from the Tk driver..
  104  4.10 Problems compiling xwin.c...
  105  4.11 Problems saving files from the Tk driver.
  106 +4.12 Why does the Tcl/TK driver use a separate process for rendering but
  107       not the X driver?
  108 +4.13 How do I create an interactive, widget-based application using PLplot?
  109 +4.14 How do I shade between a 4 color range with the Tk driver?
  111 ==============================================================================
  112 Section 5: All other drivers & supported platforms
  114  5.1  What about support for platform..
  115 =5.2  What about PLplot support for VMS?
  116  5.3  PLplot is aborting with: Error opening plot data storage file.
  117  5.4  Is there a Windows port of PLplot?
  118 +5.5  I'd like to develop a windowed interface to PLplot for..
  119 +5.6  What about PLplot support for the Mac?
  120 +5.7  What about PLplot support for OS/2?
  122 ==============================================================================
  123 Section 1: Installing PLplot
  124 ==============================================================================
  126  1.1  How do I build & install PLplot?
  128 For a Unix-based system, it is usually as easy as typing 'configure', then
  129 'make', then 'make install'.  However I strongly recommend that you first
  130 read the file INSTALL in the distribution directory.  For non-Unix systems,
  131 look at the system-dependent notes under sys/<system name>.
  134  1.2  Where should I install PLplot?
  136 The configure script and Makefile are set up so that you can put the
  137 various components of PLplot virtually anywhere.  By default, it installs
  138 into a directory with the following subdirectories:
  140 bin       doc       examples  include   info      lib       tcl
  142 On Unix systems I recommend using a directory just for PLplot.  Somewhere
  143 under /usr/local is a good place.  For one, it's not too difficult to get
  144 a system administrator to give you ownership of a directory somewhere in
  145 the public hierarchy.  On a smaller system, giving the package its own
  146 directory helps maintain system integrity.  The practice of dropping
  147 everything into /usr/local/bin, /usr/local/lib and so on (or even worse,
  148 /usr/bin, /usr/lib, etc) makes everything simple to install initially but
  149 leads to a system that's difficult to organize and maintain.  There's the
  150 possibility for file name collisions -- stuff that isn't in your search
  151 path but needed anyway (readme, doc, and config files).  There's no way to
  152 cleanly & robustly back out the revision.  There's no way to tell where
  153 each file in /usr/local/bin (lib, etc) came from.
  155 Any sufficiently large/complicated package has this problem.  Dedicating a
  156 directory tree is a good way to preserve the package's integrity.  The only
  157 good reason I've heard so far for NOT doing this (apart from laziness when
  158 installing) is that people then have to modify their search paths and other
  159 settings to use the new package.  Therefore, I've written a script that
  160 takes care of that.  Run doc/mklinks from the install directory, to create
  161 softlinks from the install directory into ../bin, ../lib, ../include, and
  162 ../man as appropriate.  Just as important, you can run it again TO
  163 COMPLETELY REMOVE THEM.  Thus it becomes trivial to install and back down a
  164 revision.  All software should work this way.
  166 Note, I've written a similar script for Tcl/TK and extensions, called
  167 "installtk".  A copy is on harbor, but the current version of "mklinks"
  168 distributed with PLplot works with BOTH.  With this I've brought up and
  169 backed out a TK rev on several occasions, and found it immensely useful at
  170 the time, which is why I wrote it :-).  I think it is the most handy in
  171 two cases: 1) when developing using new betas, or 2) in a production
  172 environment, where you want to bring up a new package but still have the
  173 old one available in case programs break.  In the latter case, the only
  174 sensible scheme is to have the package in its own directory.
  176 Now, if after all that you STILL want to break the package up, just set
  177 the appropriate shell variables for the install directories before running
  178 configure, in ~/config/cf_plplot.in (see configure notes).  That way you
  179 can put the docs, examples, and tcl files under e.g. $prefix/plplot, and
  180 everything else under $prefix/bin, $prefix/lib, $prefix/include,
  181 $prefix/man (imagine $prefix=/usr or $prefix=/usr/local and this will make
  182 perfect sense).  OK, there are no man pages yet, but there will be one of
  183 these days.
  186  1.3  (moved)
  189  1.4  I don't have an ANSI compiliant C compiler.  How do I compile PLplot?
  191 Get an ANSI C compiler.  The cheap solution is to get gcc up if it has
  192 been ported to your machine.  This is not unreasonable IMHO -- the C
  193 standard was approved in 1989.  Isn't it about time you upgraded?
  196  1.5  I don't have a fortran compiler; how do I compile PLplot?
  198 The Fortran files are only part of the interface layer for Fortran codes
  199 that use PLplot.  If you don't need this capability the layer can be
  200 omitted by running configure with the --disable-f77 flag under Unix.
  202 Alternately, you can use 'f2c' (freeware fortran-to-C translator) to
  203 compile the layer, assuming it (f2c) has been ported to your system.
  206  1.6  The linker complains of unresolved functions atexit(), fsetpos(),
  207       fgetpos(), and so on.
  209 This is caused by a non-ANSI libc.  It /is/ possible to run PLplot on such
  210 a system, but at slightly reduced functionality -- I rely on ANSI libc
  211 functions both for seeking (fsetpos, fgetpos) and for cleanup (atexit),
  212 but neither is absolutely essential.  Currently the configure script
  213 should detect this condition automatically and make the necessary defines
  214 to avoid any problem.  If not, let me know and I will fix it.
  217  1.7  The compiler complains about the use of "malloc" or "size_t".
  219 Once upon a time, the source code went to some lengths to make sure
  220 these were properly prototyped/typedef'ed even on systems that weren't
  221 completely ANSI-compliant.  Now the code assumes they are in the usual
  222 places:
  224 	malloc	should be declared in stdlib.h
  225 	size_t	should be typedef'ed in stdio.h (sometimes is in stdlib.h
  226 		also, and sometimes only in stdlib.h.  The latter is a
  227 		violation of the standard but I look for it there too.)
  229 Since most of the PLplot source files need something from either stdio.h
  230 or stdlib.h, I include them both.  If this does not work on your system,
  231 there are two things to try.  First: fix the headers.  You can leave the
  232 current definition in place as long as you "wrap" it, e.g.:
  234 #  ifndef _SIZE_T
  235 #    define _SIZE_T
  236      typedef unsigned int size_t;
  237 #  endif /* _SIZE_T */
  239 Then add an identical declaration where it is *supposed* to be.  The
  240 second way is to hack plplot.h to explicitly prototype/typedef it.
  243 =1.8  The compiler complains about "caddr_t" in one of the X support files.
  245 This is sometimes seen on systems that have X11R4 and claim POSIX
  246 conformance but that don't quite have their act together.  Typically on old
  247 versions of Unicos, Ultrix, and DGUX for example.  Currently the configure
  248 script determines whether caddr_t is typedef'ed, and if not, typedefs
  249 caddr_t appropriately.  Note that under POSIX.1, caddr_t is NOT supposed to
  250 be set.  But because of the various broken headers out there I compensate by
  251 typedef'ing it except when it is (illegally) already typedef'ed (note: at
  252 least some versions of gcc perform the same "fix").  In any case, it should
  253 always work, and if not let me know.
  256  1.9  configure script doesn't run correctly
  258 The current configure script should work under even some very old versions
  259 of "sh".  But in the event of problems, look around for a different shell
  260 to run it under (posix shell, ksh, /bin/sh5, etc).
  262 Be sure to check that the system name is being set correctly.  Your system
  263 must have the "uname" program.  If not, you can roll your own easily
  264 enough -- here's one for HPUX:
  266 --cut-here--cut-here--cut-here--cut-here--cut-here--cut-here--cut-here-
  267 #!/bin/sh
  268 #
  269 #       File: uname
  270 #       Usage: uname
  271 #
  272 #       Minimal implementation of the uname command -- no arguments
  273 #       supported.
  274 #
  275 echo "HP-UX"
  276 --cut-here--cut-here--cut-here--cut-here--cut-here--cut-here--cut-here-
  278 Alternately, you can explicitly set "system" either as a shell variable or
  279 in the defaults file.
  282  1.10  (removed)
  285  1.11 The linker complains that it can't resolve Tcl_AppInit.
  287 The Tcl7.0/TK3.3 and later libraries contain a function called "main".
  288 As a result, when linking you don't always get the correct main program.
  290 This was done to make it easier to build custom versions of wish, so
  291 all you had to do is to create your own version of Tcl_AppInit, link
  292 with the library, and POOF! there is your modified wish.  Unfortunately
  293 it sometimes sends the fortran compiler / linker into spasms, because
  294 it gets the wrong main!  I have had exactly this problem under a 2-year
  295 old version of SunOS (but not under a more recent one), and couldn't
  296 get it to work despite varied link invocations.  BTW, I hear a similar
  297 problem exists under Linux from a C++ main.
  299 My solution on these platforms was to recompile the tcl and tk libraries
  300 without the file including the main program (I think it was tclMain.o and
  301 tkMain.o).  I installed the new libraries as well as the separately compiled
  302 *Main.o's in case someone needed them.  No more problem with the Fortran
  303 compiler.
  305 Another case where this may come up is using f2c to compile a Fortran
  306 main, in which case the true main is in libf2c.a.  In this case, putting
  307 -lf2c BEFORE -ltk -ltcl on the link line will usually do the trick.
  310 +1.12 Can the library place be changed *after* compilation, say, by an
  311       environment variable ?
  313 The environment variable "PLPLOT_HOME" may be used to override the
  314 default installation place such that
  316 ${PLPLOT_HOME}/bin	is the binaries' location
  317 ${PLPLOT_HOME}/lib	is the library/fonts location
  319 if you only need to override a single value, the environment variables
  320 "PLPLOT_BIN" and "PLPLOT_LIB" may be used to individually specify the
  321 locations of the binaries and of the library/fonts, respectively.
  323 So that in your case, setting PLPLPOT_LIB might be enough.
  325 Below is a "cutting" from plctrl.c
  327 /*----------------------------------------------------------------------*\
  328  * char *plFindCommand
  329  *
  330  * Looks for the specified executable file.  Search path:
  331  *	current directory
  332  *	PLPLOT_HOME_ENV/bin = $(PLPLOT_HOME)/bin
  333  *	BIN_DIR
  334  *
  335  * The caller must free the returned pointer (points to malloc'ed memory)
  336  * when finished with it.
  337 \*----------------------------------------------------------------------*/
  339 /*----------------------------------------------------------------------*\
  340  * FILE *plLibOpen(fn)
  341  *
  342  * Return file pointer to lib file.
  343  * Locations checked:
  345  *	current directory
  346  *	PLPLOT_HOME_ENV/lib = $(PLPLOT_HOME)/lib
  347  *	LIB_DIR
  348  *	PLLIBDEV
  349 \*----------------------------------------------------------------------*/
  352 +1.13 tcpip.c won't compile.
  354 Probably a header file problem.  For example, under some versions of Linux,
  355 the compile fails with optimization on.  The header file stdlib.h is busted.
  356 Either fix the header file, turn off optimization, or put -U__OPTIMIZE__ on
  357 the compile line (best).
  360 ==============================================================================
  361 Section 2: Philosophy, future directions, broad capabilities, etc.
  362 ==============================================================================
  364  2.1  Why should I use PLplot?
  366 This is probably the first question I was ever asked, and it continues
  367 to come up often enough to dwell on it a bit.
  369 First off, my involvement with PLplot came from a very simple need: a
  370 portable, free, reasonable quality scientific graphics package.  At the
  371 time I had a 1 year fellowship in Japan, to continue my work on numerical
  372 simulation of plasmas.  Previous to this, I and my colleagues had
  373 laboriously translated the simulation code graphics to use two other
  374 libraries (one quasi-commercial and one PD), only to find both packages
  375 lacking in some important respects (most notably the PD one) and unable to
  376 easily (or cheaply) obtain the commercial one where I was working in
  377 Japan.  This was an extremely frustrating situation, which had always been
  378 apparent to me but only then came to a head.  Scientific graphics is an
  379 utter necessity to anyone doing numerical modelling, and I decided that
  380 being at the mercy of vendors and computer centers on this issue was
  381 unacceptable.
  383 I have no objection to commercial software, but let's face it.. sometimes
  384 commercial solutions suck.  This is one of those times.  You don't have
  385 access to the source code, so you can't improve it to suit your needs
  386 better, and you certainly can't freely carry it to different machines.
  387 Software environments on high-performance Unix systems, especially as
  388 regards commercial software, are VERY variable from machine to machine.
  389 Regardless of why this situation exists, I decided I could no longer
  390 depend on commercial software to provide a basic graphics capability.  I
  391 was somewhat familiar with PLplot for the Amiga, and seeing that it was
  392 fairly capable and portable I decided this would be the "last" graphics
  393 package I would use and support (for a long while at least).
  395 It turned out that PLplot required some substantial investment of my time
  396 before it satisfied all of my (then) needs, but has nonetheless performed
  397 quite well.  In the interim I took over development for it from Tony
  398 Richardson.  The package has become almost trivially portable -- we can
  399 now get our codes running on a new machine in record time.  We can fix
  400 bugs in record time, although it doesn't always happen that way :-).
  401 Still, it takes less than a month or two for me to get around to fixing
  402 most bugs, which is better turnaround time than you typically get from
  403 vendors.  New features can be added with astonishing speed if the need
  404 (ours) is great enough.
  406 So those are some of the reasons /I/ got involved, which may differ from
  407 those of the casual user.  Most people won't be digging into the source
  408 code to fix bugs, although it's very reassuring to know that you can if
  409 you need to.  I can't promise quick bug fixes or specific enhancements as
  410 my responsibilities (i.e. funding) lie elsewhere.  But I am always
  411 interested to hear what people want, since if it's a good idea I will
  412 benefit too.  User-contributed code is always welcomed (there has been
  413 quite a bit).  And backward incompatibilities will be introduced into the
  414 package sparingly if at all.
  416 The features supported by PLplot are necessarily fewer in number than a
  417 big commercial package.  PLplot has a fairly complete set of basic
  418 graphical capabilities, and a few very strong capabilities (e.g.  the
  419 Tcl/TK "plframe" plotting widget, and the GUI drivers built around it).
  420 This has its good and bad points.  The good part is that the library is
  421 relatively small, and can be modified without too much difficulty.  The
  422 disk space required is reasonable (especially if shared libraries are
  423 used), and the learning curve mild.  The effort I might expend adhering to
  424 some large set of capabilities (many of which may be only rarely used;
  425 e.g. look at the GKS standard) can be focused instead on portability, user
  426 interface, and certain select capabilities that I and my colleagues find
  427 important.
  429 On the other hand, there are many nice capabilities missing from PLplot at
  430 present, such as support for solid 3d modelling or postscript fonts, just
  431 to name two.  New features are continually being added, but the fact
  432 remains that other more special purpose (and/or high priced) products will
  433 always have things that PLplot lacks (or do them better).  One way I see
  434 to fit PLplot in the overall software environment is to add more output
  435 drivers, both for generic file formats (e.g. GIF, CGM) as well as for
  436 specific high-end graphics packages (e.g. AVS).  That way you could
  437 produce your graphics and view them using PLplot, dumping to disk those
  438 pages or plots you want to process using a separate package.  This can
  439 already be done using the XFig driver, for example.  For maximum
  440 effectiveness of this scheme, PLplot should have internal knowlege of more
  441 varied objects than "line" (currently the fundamental unit), and I have
  442 some plans in this area.
  444 I'm always interested in gaining new collaborators and contributors for
  445 PLplot, so feel free to send me email (mjl@dino.ph.utexas.edu) so we can
  446 discuss additions you'd like to make.  Want to help support PLplot but
  447 need suggestions?  I hesitate to recommend anything that will require
  448 broad changes to the package, but any of the following would be great:
  450 	volunteers for target platform support (I have HPUX covered)
  451 	output drivers: GIF, CGM, others?
  452 	PLplot demos?  (especially using Tcl/TK)
  453 	an improved contour plotter
  454 	any interesting ideas/code for TK widgets for use with PLplot
  455 	anything from the ToDo list you'd like to tackle?
  456 	help rewriting the manual?  (OK, so I'm really reaching here)
  459 +2.2  Could you comment on the pros and cons of plplot and gnuplot?
  461 They came from a different set of objectives initially.  PLplot started
  462 out primarily as a library and gnuplot as an interactive tool.  At one
  463 time gnuplot acquired some library-like capabilities but these were never
  464 merged back into the master sources, and are quite out of date by now (I
  465 hear).  PLplot is becoming more interactive.  Eventually I think PLplot
  466 will surpass gnuplot even for interactive plots for the following reasons:
  468 (a) it will have full access to the underlying plot library, which is more
  469     varied than gnuplot (with good support for contour, surface, 3d plots,
  470     etc).
  472 (b) the scripting language I use for it is Tcl (note: there are others
  473     too, see questions 2.3, 2.4).  Tcl has a large following and is fairly
  474     well thought out, rather than a home-grown language.
  476 (c) the most advanced driver is based on Tk, an X-windows tool kit, and
  477     both (Tk and the PLplot capabilities based on it) are very powerful.
  479 Unfortunately as it stands, (a) is not true yet, and the documentation
  480 that describes all the current features is not done either.  This will be
  481 rectified by the time I release 5.0.
  484 +2.3  How do I use PLplot to do interactive plotting?
  486 > I am planning to use PLPLOT to plot some 2D pictures about software bug
  487 > generation rate, bug correction rate, and etc. Using gnuplot I could put
  488 > the X-Y data pairs in a file then use the 'plot' function. Is there a
  489 > similar idiom in PLPLOT?
  491 Such a thing is easily constructed in Tcl.  I never bothered cooking up a
  492 demo because it was too easy :-).  But now I have one (~30 minutes of work,
  493 modelled after elements of x01.tcl) -- it is included in the distribution
  494 as examples/tcl/plot.tcl.  To test it, type:
  496 % pltcl
  497 pltcl> source plot.tcl
  498 pltcl> plot foo.dat
  500 from the examples/tcl directory.  As you can see, it is quite easy to use
  501 Tcl for things like this and it's almost not worth it to construct huge
  502 mega-commands like GNUPLOT's "plot" command, since the user can now write
  503 Tcl procs to do exactly what is needed (i.e. without inventing a new API).
  504 Therefore, I doubt I'll improve plot.tcl to be more like the GNUPLOT call,
  505 although if someone does write such a beast and wants to share it, that's
  506 great.
  508 The main disadvantage of using pltcl for such things is that I don't often
  509 use it, and am therefore slow to improve it.  It needs more work on the 2-d
  510 API (for contour, surface, and shade plots), better access to internal
  511 variables, and so on.
  513 Also, there are alternatives.  Currently Ian Searle's RLaB and my pltcl are
  514 the two best supported interpreter front-ends to PLplot.  Radey Shouman
  515 wrote a Scheme (SCM) interface which may appear publicly before long.  John
  516 Interrante wrote a python interface which I am integrating with the main
  517 sources.  And at one time there was a PLplot-based interpreter on the Amiga
  518 that used Rexx as its script language (maybe OS/2 users would be interested
  519 in this too, but unfortunately it's way out of date now).
  522 +2.4  What is RLaB?
  524 RLaB is an interpreted/interactive  matrix programming language which
  525 uses Plplot. RLaB has implemented most of the Plplot API so that users
  526 can interactively visualize data. Additionally there is a higher level
  527 abstraction of the Plplot capabilities that allows users to do things
  528 like:
  530 	x = readm("mydata");
  531 	plot(x);
  533 or
  535 	x = readm("mydata");
  536 	X = fft(x);
  537 	plaxis("log", "log");
  538 	plot(abs(X));
  540 RLaB is geared towards scientific/engineering usage, but could also be
  541 quite useful for other types of data.
  543 RLaB is a "High Level Language" with matrices (2-d arrays) as a
  544 fundamental object. Thus:
  546 	b = A*x;
  548 where b is (Mx1), A is (MxN), x is (Nx1) works as expected. RLaB
  549 includes a host of builtin linear-algebra, an spectral functions,
  550 taking advantage of LAPACK, BLAS, and FFTPACK. Although RLaB may be
  551 more than the original poster wants, I think it is at least worth a
  552 mention.
  555 +2.5  Why should I use Tcl?
  557 > I've recently seen an article on the net (comp.lang.tcl:19017)
  558 >
  559 > 	Title:		Why you should not use Tcl
  560 > 	Author:		Richard Stallman, GNU Project.
  561 >
  562 > In which a case was made to avoid a "scripting language" such as Tcl in
  563 > favour of a language that is more easily extended.
  564 > ...
  565 > If indeed Richard Stallman knows what he is talking about, then is Tcl
  566 > really the best way to extend PLplot?
  568 (here I break from my usual convention and attribute responses)
  570 Geoff's response:
  572 Since you saw this post by RMS on c.l.t, I'm sure you also saw the
  573 extremely severe flame fest which ensued.  I think it would be good to
  574 avoid repeating that on this channel, so let me refer interested
  575 parties to the newsgroup for all the gory details.  But since you are
  576 clearly trying to probe what our thinking on these issues is, I will
  577 provide at least a restrained response.  Perhaps Maurice can do the same:
  579 I have to say first that I have a great deal of personal respect for
  580 the FSF and it's accomplishments, though I am less impressed by it's
  581 stated aims.  Nevertheless, I use GNU tools daily, especially but not
  582 limited to GCC, and have even hacked GCC some myself.  PLplot is now
  583 distributed under the LGPL.  etc.
  585 However, in this case, the informed mind has to conclude, that Richard
  586 Stallman spoke out of turn.  It is most unfortunate that he used his
  587 position of influence in the free software community to cast such a
  588 spectre of FUD and inanity on Tcl/Tk.  Certainly on technical merit,
  589 his post was vacuous.
  591 > Opinions on how PLplot should proceed?
  593 I think Maurice and I are both squarely in the camp of:
  595 	"Let each man choose his own tools"
  597 and we have chosen ours :-).  If others want to go with Scheme (or
  598 Python, or WINTERP, or whatever), that's fine by us, and we are
  599 willing to help integrate and incorporate such user-contributed
  600 modifications into the distribution.  In point of fact, there already
  601 is a Scheme port of PLplot, done by another fellow in Austin, and we
  602 are working with him to increase the visibility of his work.
  604 As for PLplot and Tcl/Tk.  I do think there is an issue with Tcl
  605 regarding the construction of large script systems.  Tcl provides very
  606 poor support for "large" software, whatever that means to a given
  607 person.  That is precisely why I recommend ALWAYS using the [incr Tcl]
  608 extension, which provides to Tcl exactly the same sorts of things that
  609 C++ provides to C.  Not everyone is sold on object oriented
  610 programming of course.  Maurice, for instance, is still basically
  611 comfortable with developing the PLplot library in C and writing the
  612 Tcl parts of the Tcl/Tk and DP drivers in plain Tcl.  I on the other
  613 hand, write new code in C++ if at all possible rather than C, and in
  614 [incr Tcl] rather than plain Tcl.  Although it is not so easy for
  615 all C users to switch to C++ (cost and availability of compilers being
  616 the main issue here), it is clearly no big deal for people who use Tcl
  617 to also use [incr Tcl] (since it is free, and just as portable as Tcl
  618 itself).  Maurice and I have been having a long standing dialogue
  619 about whether to make [incr Tcl] a required addition to Tcl for
  620 PLplot.  Many parts of the PLplot Tk interaction could be provided in
  621 a more robust, more customizeable, and most importantly more
  622 extensible fashion if they were done in [incr Tcl].  Certainly all the
  623 contributions I am making are being done in itcl, Maurice is still
  624 making up his mind on that one.
  626 In any event, there is certainly no reason why PLplot cannot be bound
  627 to other scripting environments, and Maurice and I do not wish to
  628 in any way discourage others from doing exactly that.  The PLplot Tcl
  629 bindings can serve as a point of reference for interested parties, and
  630 so can the Scheme port.
  632 The motto in our office is:
  634 	"Go wild!"
  636 So if you've got an idea that involves something radically different
  637 from Tcl/Tk/[incr Tcl], we say, "great, go wild!"  Send us the diffs.
  639 Maurice's response:
  641 This post of RMS's inspired a truly awesome flamefest on the newsgroups
  642 specified on the Followup-to: line, which were comp.lang.tcl,
  643 gnu.misc.discuss, and comp.lang.scheme.
  645 This whole thing would have been avoided if RMS had more net experience.
  646 Those of us who have spent considerable time on the net know better than
  647 to get on some language group and essentially say "your language sucks",
  648 or to get on a computer group and say "your computer sucks".  Usually,
  649 there are many fine points involved which the poster, no matter how well
  650 educated, simply doesn't have a clue.  This is one of those cases.
  652 Tcl is not the perfect extension language.  I'm not sure that Scheme is
  653 either.  Does it matter?  And Tcl *can* be improved further.  E.g. Geoff
  654 mentioned [incr tcl], an OO Tcl extension.  I am currently flirting with
  655 the idea of requiring it for the PLplot Tcl-TK part in some future
  656 revision, after some reasonable period of supporting the old code.  Since
  657 [incr tcl] supports vanilla Tcl as well, the only real drawback is that
  658 yet another package is required to be present, but this isn't that big a
  659 deal.
  661 Tcl is very popular and getting more so.  It's easy to use and easily
  662 embeddable in a C or C++ application.  There is one book out on Tcl/TK
  663 programming (JO's) and at least one more in the works.  Plus it has
  664 copious online documentation.
  666 Finally, Tcl *has* been ported to non-Unix systems.  Although it would
  667 help if JO directly supported this effort.  Looking at the new contrib
  668 site (ftp.aud.alcatel.com) I see ports to MSDOS, the Mac, and VMS, and
  669 I know of an old port to the Amiga as well.
  671 This note just scratches the surface.  Basically, I predict a bright
  672 future for Tcl, and plan to use/support it with PLplot for a long time to
  673 come.
  676 +2.6  What are some of the planned enhancements to the PLplot interactive
  677       capabilities?
  679 By mirroring the C api in Tcl, it is becoming possible to rapidly
  680 prototype data interaction programs, coded entirely as Tcl scripts,
  681 generating PLplot output through Tcl commands.  There are some demos of
  682 this, but much much more can be done.
  684 It would be really nice to have someone contribute Tcl code which went
  685 farther in this direction.  With a small amount of Tcl programming, it
  686 is easy to imagine very powerful interactive data analysis
  687 capabilities.  Especially if these were provided as itcl classes, it
  688 would then be possible to provide data analysis modules in Tcl/Plplot
  689 which could then be "popped" into a code as easily as using the Tcl
  690 autoload on demand mechanism.
  692 Example itcl classes could be things like:
  693 	1-d histogram utility
  694 		reads data from specified file, puts up some
  695 		buttons to allow generation of histograms with
  696 		various different options
  697 	Financial analyst
  698 		reads data from a file, produces various sorts of bar
  699 		and pie charts.
  700 	Linear regression analyzer
  701 		reads data from a file, performs least square and
  702 		other forms of regression, calls histogram utility
  703 		(above) to generate graphs.
  704 	FFT analysis package
  705 		reaads 1 or 2 d data from a file, performs transforms,
  706 		plots spectral data in 1 or 2 d.
  707 	Volumetric data slicer
  708 		reads 2 or 3 d data from file, presents plshaded
  709 		contours with scale widgets for selection of cut
  710 		planes, isosurfaces, etc.
  711 	Functional calculator/explorer
  712 		provides entries for a mathematical expression, min
  713 		and max domain values, and plots the equation.
  714 		Provides buttons for performing integration,
  715 		(numerical) differentiation, fourier analysis (coupled
  716 		to the above mentioned package), spline fitting,
  717 		root finding, etc.
  719 Some of these ideas will require the 2-d Tcl api, which is still being
  720 worked on, but which is definitely coming.  We (Maurice and I) cannot
  721 hope to address all these issues ourselves, as we have other work to
  722 do.  We would very much like to see user contributed code in these
  723 areas.  I can provide direction to anyone who is interested enough to
  724 seriously explore these issues.  Basically I would recommend getting
  725 itcl, and working through the "tkdemos", making sure you understand
  726 the "embedded plframe" concept (discussed in the new chapter of the
  727 manual), etc, as a great start.  From there, the plan would be to
  728 construct families of itcl classes embodying packages of widgets
  729 (megawidgets in Tk parlance) which perform the above sorts of tasks,
  730 or any others of your invention.
  732 The potential is great, and the current demos only hint at what is
  733 possible.  We long to make PLplot the premiere scientific plotting and
  734 data analysis package, but there is only so much work we can do in so
  735 much time.  There are tremendous opportunites for enterprising souls
  736 to make great contributions in these areas.  This would be fabulous
  737 material for undergraduate semester projects in CS/math/engineering
  738 computer-lab type classes, if there are any professors on this list
  739 :-).  Anyone who is interested in working in this sort of area is
  740 welcome to contact me for further elaboration.
  743 +2.7  Is there a PLplot newsgroup?
  745 > I think one way to achieve better support/development of the PLPlot
  746 > package would be to create a newsgroup to give such requests as the above
  747 > a wider audience. Maybe something like comp.grahpics.PLPLOT?
  748 >
  749 > This could also be the place to ask questions like "How do I do this..."
  750 > or "I have a problem doing this, can anyone help me?".
  751 > Apart from that it could alleviate the pressure of supporting PLPlot by
  752 > the primary developers (GF & MJL) so that they can spend more time
  753 > actually doing new development.
  755 A newsgroup comp.graphics.plplot would be fine with me.  In fact, I've
  756 long expected that one day it would happen.  Unfortunately I know nothing
  757 about starting a newsgroup, and also I'd want to relay it with the mailing
  758 list, which again I know nothing about.  I sort of wanted to get the 5.0
  759 release off before that step, with the implied finishing of the
  760 documentation :-).  But sooner would be OK.  If anyone wants to start the
  761 ball rolling on this, let me know.
  763 A positive note: as of May 1995 the mailing list has been converted to use
  764 Majordomo, which is a significant enhancement.  Users can now subscribe or
  765 unsubscribe themselves (leaving me with more time for real work), see who
  766 else is on the list, and retrieve the README, FAQ, and mailing list archive
  767 by email.  Just send the message 'help' (in the body of the message, not
  768 the subject) to plplot-request@dino.ph.utexas.edu for a full list of the
  769 things you can do.
  772 ==============================================================================
  773 Section 3: Specific features/capabilities
  774 ==============================================================================
  776  3.1  The manual doesn't mention capability..
  778 The manual is waaay out of date.  Consult the last few update files to
  779 keep tabs of what's going on.  Take a look if there are are any
  780 substantial new capabilities in the example programs.  We went wild on the
  781 manual a while back, rewriting it in LaTeXinfo so that we could publish it
  782 in info file form.  That info file is available in the doc directory, but
  783 unfortunately (a) it still needs some polish and (b) it is still waaay out
  784 of date.  The next big push will see the end of it.
  787 =3.2  How do I change the default background color?
  789 Use the -bg option, or set by the plscolbg() API call.
  791 In general it is safest to make all settings that may affect the driver (pen
  792 width, color, etc) directly before the driver is initialized, i.e. before
  793 calling plinit.  It turns out that the Xwin driver has a firm concept of the
  794 background color, and changing it on the fly isn't hard.  Postscript (level
  795 1), however, does not have the concept of background color.  So to get a
  796 specific background color, a rectangle covering the background must be drawn
  797 and then filled using the appropriate color.  Anything previously drawn is
  798 obliterated.  So clearly, changing the background color should at least have
  799 no effect until the next bop, and in the 4.99i (and before) ps driver, only
  800 the initial setting is honored.  From 4.99j and later, the driver can get
  801 the background color right on the next bop.  Still, to get the correct color
  802 starting from page 1 you need to set it before calling plinit, because
  803 plinit does a bop.
  805 Note that in 4.99i and before, the background color fill in the ps driver
  806 was always done, independent of the color.  This is unnecessary and even bad
  807 in some cases, if the background is just white.  E.g. when generating color
  808 ps output as EPSF input to a document, a background fill causes the figure
  809 to overwrite parts of the page that you probably want to keep.
  812  3.3  I'm getting core dumps when calling a contour function from C.
  814 Aha.  Did you specify the minimum index as 1, not 0?  This is a leftover
  815 from when the package was written in Fortran, sigh.  I'm not sure why this
  816 isn't explained in the manual -- I just looked and there is no mention of
  817 it.  When I first got involved I mainly learned how to use the package
  818 from the demo programs and so didn't really notice the inconsistency.
  819 I've added some more explanatory error messages and will improve the
  820 document in this area.  Unfortunately it may be too late I think to change
  821 the minimum index to 0, since by now many people are used to this way.
  822 Maybe add some new function calls to fix up the API..
  825  3.4  Changing the default line width doesn't have any effect.
  827 Not all drivers support multiple line widths, in particular,
  828 pixel-oriented ones such as all the Tek drivers.  Further, it may not even
  829 mean the same thing from driver to driver.  If this ever becomes a serious
  830 enough inconvenience I may take a harder look at it.  One problem is that
  831 display devices typically don't have the resolution for resolving the
  832 difference between different line widths.  For example, you can output
  833 a plot using different line widths to a postscript file, and the lines
  834 don't appear any visibly thicker until you hit 5 or so (so 1-4 look the
  835 same, same for 5-8, and 9-10, or something like that).  The only real
  836 way to see the difference is to print it.  Another problem is that there
  837 may be no device support for multiple line widths.  In this case you
  838 can mock it up by drawing lines multiple times (very close together),
  839 but this is a real pain.
  841 The driver does initialize the width to something reasonable, but only
  842 if the user hasn't already set it (i.e. it is zero).  The postscript
  843 driver uses a line width of 3 as a default, since this produces pretty
  844 good results.
  847 =3.5  How can I generate more than 16 line colors?
  849 Two ways.  1. You can increase the number of colors in cmap0 with the -ncol0
  850 option.  2. You can use cmap1 to do it, via plcol1().  Each color will be
  851 interpolated along a piecewise linear curve in HLS space.  This gives an
  852 arbitrarily smooth color variation (for some drivers) with cmap1 index (in
  853 range 0. to 1.).
  856  3.6  What 2-d array organization am I supposed to use from C?
  858 The 2d array organization has an interesting history.  Back in plplot 2.6b
  859 all the C API functions that took 2d arrays used column dominant
  860 contiguous storage, while the corresponding Fortran API functions used row
  861 dominant contiguous storage (naturally).  The latter allocated temporary
  862 arrays and performed a transpose before calling the C API.  With plplot
  863 3.0 Tony Richardson changed the C API to use arrays-of-arrays of pointers
  864 to increase performance on some platforms.  Unfortunately on high end
  865 platforms (vector machines or superscalar RISC workstations) performance
  866 can actually be worse as a result -- slowdowns due to memory access can be
  867 much worse than doing extra computation.
  869 As a result the situation re: 2d array organization in C became somewhat
  870 confusing -- now there was a /third/ type of array organization, or /four/
  871 if you want to count "normal" C array-of-pointers organization.  So I
  872 decided, years ago, that I wanted to have a general way of specifying
  873 array organization to be used by the 2d function API, with front-end
  874 routines used for converting from popular techniques.  But as it isn't so
  875 glamorous a pursuit, I've been slow to get it finished. :-\
  877 The key idea is that for each major capability, there should exist a core
  878 function that takes the array in a totally arbitrary way -- as a function
  879 evaluator and its data.  This can be used directly if desired -- for
  880 example by a C++ user with his own matrix class.  However I also will
  881 provide front-end C API calls to handle the various popular 2d array
  882 organizations.  These front-ends merely pass in the appropriate function
  883 evaluator to the core routine, passing the user's array as data.  This
  884 results in calls like plfcont(), which is the core routine, and plcont1(),
  885 plcont2(), etc, which are the front-end routines.
  887 The core routine can do one of two things: it can either use function
  888 evaluations in place of the 2d array lookups in its computations, or
  889 create a temporary array in some standard internal format for its
  890 computations.  Both have their merits.  On low-end machines, the function
  891 evaluator approach is better (since there is little loss of pipelining and
  892 no temporary memory hit), while on high-end machines the reverse is true.
  893 On the other hand, on high-end machines the odds are better that you are
  894 spending most of the CPU time on things other than graphics, and
  895 efficiency is less important.  So I tend toward using the function
  896 evaluator where it is convenient.  In the contour plotter the function
  897 acceses are clear and it was easy to substitute a function evaluator.  In
  898 plshade, however, the code is a bit too involved for this to be done
  899 easily so instead I've gone the temporary array route.  Either way, as
  900 long as the API is put in place and documented, I can always go back and
  901 change things around internally later on.
  903 My intentions right now is to give this a good look very soon, so that
  904 if I need to break the C API to make it more consistent, it happens
  905 before I release 5.0.
  908  3.7  On stretched windows, the string characters look bad..
  910 > - If I make a window of say y=100 and x=1000 the character are rather
  911 >   stretched. Is there a way to avoid this.
  913 I haven't had the need for it and am barely familiar with how to do it.
  914 The best way to fix it won't happen until I support actual text by the
  915 driver, which is a long ways off yet.  But I think you can specify
  916 physical dimensions of your output device using plspage().  In fact,
  917 plspage() is called by the argument parser for the -geometry flag, but the
  918 options specifying physical dimensions -- xpmm and ypmm -- aren't filled
  919 in.  I can put changing this on my todo list.  But if it works, it will
  920 only work as long as the window isn't resized.
  922 Eventually, the driver and internal page representation will be
  923 intelligent enough to support page resizing without changing the aspect
  924 ratios of certain objects such as characters, strings, fixed aspect
  925 viewports, etc.  But like I said, it's a way off.
  928 =3.8  I would like to capture key sequences..
  930 >   Also, I would like to be able to capture the PF2 and PF4 keys. My
  931 >   application consistently uses these keys for particular responses. If
  932 >   I can catch them, the application can take appropriate action.
  934 You can catch these now from C by installing a keyboard event handler,
  935 via the function:
  937 /* Set the function pointer for the keyboard event handler */
  939 void
  940 plsKeyEH(void (*KeyEH) (PLGraphicsIn *, void *, int *), void *KeyEH_data);
  942 You can look at the code in plrender as an example.  It uses a keyboard
  943 event handler in order to detect & act on page seeking commands.  It would
  944 be possible to mock something up for Fortran too if needed.  There is no
  945 problem with doing this from X since only a single key code is
  946 transmitted, but an xterm sends an escape sequence.  Your event handler
  947 would be called for each key code which makes recognition a bit harder but
  948 still doable (if in an xterm).
  951 -3.9  How to get more information about a function or capability.
  953 > I would like to be able to take advantage of the new routines that came
  954 > with 4.99g, but to do this I need to know the argument list that is
  955 > supplied to each one - the additional docs that came with 4.99g are very
  956 > sketchy on this.
  957 >
  958 > I would particularly like to use plscmap1l, which I have had trouble
  959 > with,  also the following which are not explained:
  960 >
  961 >  *      plwarn plexit plcol0 plcol1 plrgb plrgb1 plscolbg plscol0 plgcol0
  962 >  *      plscmap1 plscmap1f1 plscolor
  963 >
  964 > Any details would be gratefully received.
  966 Well for me to really explain would be basically the same as finishing the
  967 docs, which I don't have time for right now.  I suggest looking at the
  968 example programs and especially the source.  Now, I know that might not
  969 sound like fun, but some of the source code is a fairly easy read.  Look
  970 in "plplot.h" -- each function has a prototype that lists arguments and
  971 has a one-line description.  The description is usually an abbreviated
  972 version of the comments written with the function itself.
  974 If you are an emacs user, browsing the source code is very easy with
  975 'tags'.  From the tmp directory, type 'etags *.c'.  Then edit plplot.h,
  976 move the cursor to the name of the function you are interested in, and
  977 type ESC-.  <poof>, you are there.  Happy hunting.
  979 p.s. Some of the new capabilities are illustrated in C example programs
  980 but not Fortran, e.g. see x15c and x16c.  x17c isn't working yet.
  983 +3.10 What are the keyboard controls in the graphics window?
  985 > Can you give me a pointer as to the other keyboard controls that are
  986 > in effect in such a window? Is it in the docs/sources?
  987 > I've noticed that Q quits the window(?)
  989 It depends on the driver to some extent.  Here are the recognized keys
  990 for the xwin and tk/dp drivers (tek is similar):
  992     case PLK_Return:
  993     case PLK_Linefeed:
  994     case PLK_Next:
  995     /* Advance to next page (i.e. terminate event loop) on a <eol> */
  996     /* Check for both <CR> and <LF> for portability, also a <Page Down> */
  998     case 'Q':
  999     /* Terminate on a 'Q' (not 'q', since it's too easy to hit by mistake) */
 1001     case 'L':
 1002     /* Begin locate mode */
 1004 You can intercept these by writing a keyboard event handler, if you want to
 1005 do various user-related things with it.  Using plfill() to do erasures, one
 1006 could even imagine writing an editing capability.  A graphical vi clone,
 1007 anyone? :-)
 1009 "plrender" installs its own keyboard event handler to add some more
 1010 keystrokes:
 1012  * Keyboard event handler.  For mapping keyboard sequences to commands
 1013  * not usually supported by PLplot, such as seeking around in the
 1014  * metafile.  Recognized commands:
 1015  *
 1016  * <Backspace>	|
 1017  * <Delete>	| Back page
 1018  * <Page up>	|
 1019  *
 1020  * +<num><CR>	Seek forward <num> pages.
 1021  * -<num><CR>	Seek backward <num> pages.
 1022  *
 1023  * <num><CR>	Seek to page <num>.
 1024  * --<num><CR>	Seek to <num> pages before EOF.
 1025  *
 1026  * Both <BS> and <DEL> are recognized for a back-page since the target
 1027  * system may use either as its erase key.  <Page Up> is present on some
 1028  * keyboards (different from keypad key).
 1029  *
 1030  * No user data is passed in this case, although a test case is
 1031  * illustrated.
 1032  *
 1033  * Illegal input is ignored.
 1035 > How do you make your user aware of this? Does anyone have an example
 1036 > of a userinterface that tells the user about this?
 1038 I've thought about having the driver spit out a list of recognized
 1039 keystrokes to stdout if the user types "?" but never felt strongly enough
 1040 about doing so.  The Tk driver has a help entry that mentions most of
 1041 the recognized keystrokes.  And you can always look at the source.
 1042 Eventually this stuff will be covered in the manual.
 1044 Also note, the Tk driver has some more sophisticated keyboard controls, some
 1045 of which are activated depending on mode.  In normal operation, 'z' causes a
 1046 zoom, 'r' causes a zoom reset, 'P' causes a print, and 's' causes a 'save
 1047 again'.  These are set in pldefaults.tcl and can be customized on a per user
 1048 basis (read the instructions in pldefaults.tcl on how to do it).  When in
 1049 locate mode, the cursor keys move the graphics cursor.  When in zoom mode
 1050 (and not locate), the cursor keys cause the view to scroll.  Adding modifier
 1051 keys (CTRL, ALT, SHIFT, etc) causes a 5x speedup for each modifier added.
 1054 +3.11 How do I get the value of a PLplot internal variable?
 1056 > 	Can anyone tell me if there is a yet-to-be-documented PLPLOT
 1057 > function which returns the name or code of the output device associated
 1058 > with the current output stream (for PLPLOT-generated graphics)?
 1060 If there's no API call to do it, it's still easy to do from C or C++.  You
 1061 just include plstrm.h and get the stream pointer using either:
 1063 extern PLStream       *plsc;
 1065 or
 1067 PLStream *plsc;
 1068 plgpls(&plsc);
 1070 Then the device name is accessed by plsc->DevName.
 1072 If you are using fortran or Tcl or whatever then you are stuck.  Consider
 1073 writing a small C function to do the job.
 1075 Note: an API call is always safest.  If you feel strongly that it's
 1076 something that should be in the API, let me know.
 1079 +3.12 I'm getting "Unable to delete command .dx.gq1" when I use a tclMatrix.
 1081 > Whenever I use the tcl matrix facility you wrote from itcl, I always
 1082 > get these annoying
 1083 >
 1084 > Unable to delete command .dx.gq1
 1086 Yeah.  I continued to look into this after you left.
 1088 > Seems you set a local variable when the matrix is created.  Then
 1089 > when the local variable goes out of scope, it is unset, which trigger
 1090 > a trace, so you try to delete the command, but can't, so the message
 1091 > is printed.
 1093 Right.  It turns out that a /different/ interpreter is trying to do the
 1094 unset.  Really strange, eh?  I don't know what magic itcl is doing here,
 1095 and don't really care to dig any further, because I can fix it so that
 1096 the variable and matrix is deleted according to the original plan by
 1097 just storing the original interpreter pointer in the tcl Matrix struct.
 1098 (done in 4.99j)
 1101 +3.13 My tclMatrix'es are being deleted while in use from itcl.
 1103 There's a lot of places in Tcl/Tk where a proc puts up some combination
 1104 of widgets with action bindings and then returns.  The parent may then
 1105 return or wait for the window to be deleted.  My 'Form2d' proc for example
 1106 does this, but I wait for it to be destroyed before proceeding so I can be
 1107 sure the input is available and act on it.  I.e.:
 1109     Form2d .e "Enter window coordinates for zoom.  Each coordinate should range from 0 to 1, with (0,0) corresponding to the lower left hand corner."
 1110     tkwait window .e
 1112 I communicate with the Form2d using global variables, which may be the only
 1113 way, since the proc goes out of scope before any user input is made!  Not to
 1114 mention that the parent may go out of scope as well.
 1116 So in 4.99j I added a way to make global, i.e. persistent tcl Matrices.
 1117 Just add the -persist flag on its creation, remembering to explicitly delete
 1118 the tclMatrix (using "<matrix> delete") when you're done.  I may add 'use'
 1119 and 'free' matrix commands to handle reference counting and deletion in the
 1120 next rev.
 1123 +3.14 I'm getting a "already exists" message when creating a tclMatrix.
 1125 A "matrix" declaration creates a command that processes all matrix commands.
 1126 Commands are always at global scope, unfortunately.  The local variable
 1127 that is set is only for GC purposes.  So there is no local scope for a
 1128 Tcl Matrix, just automatic GC (unless you use -persist).
 1131 ==============================================================================
 1132 Section 4: X-based drivers (includes Tcl/TK, Tcl-DP)
 1133 ==============================================================================
 1135 =4.1  Where do I get Tcl/TK or Tcl-DP?
 1137 The best way is by anonymous ftp.  The main distribution site for Tcl/TK
 1138 is ftp.cs.berkeley.edu in /ucb/tcl, and the main archive site (home of all
 1139 user-contributed extensions as well as a mirror of the main site) is
 1140 ftp.aud.alcatel.com in /tcl.  Also consult with the comp.lang.tcl
 1141 newsgroup on Usenet.  Tcl-DP can be obtained by anonymous ftp from
 1142 mm-ftp.cs.berkeley.edu in pub/multimedia/Tcl-DP, and is highly
 1143 recommended.  At the time of this writing, the versions that are fairly
 1144 certain to work with PLplot are:
 1146 tcl7.3
 1147 tk3.6
 1148 tcl-dp3.1
 1149 tcl-dp3.2
 1151 Earlier versions may be iffy.  PLplot does NOT yet work with tk4.0 (in beta
 1152 as I write this).
 1154 Note: the Tcl/TK, Tcl-DP header files should be found automatically by the
 1155 configure script if they are in a relatively predictable location.  Many
 1156 locations are checked; see cf/sysloc.in for more info.  If they aren't
 1157 found on your system, consider: (a) moving them, (b) making softlinks to
 1158 one of the searched-for locations, (c) if you REALLY think your location
 1159 should be searched for automatically, feel free to ask me to change it.
 1162  4.2  How do I use "xauth"?
 1164 The 7.0/3.3 and later releases of Tcl/TK require xauth security in order
 1165 to accept send requests.  The only problem is that you have to
 1166 *completely* eliminate use of the older xhost method.  So typing "xhost -"
 1167 isn't good enough -- you must also explicitly delete all the names from
 1168 the xhost access list (type just "xhost" to see them).  That should do it
 1169 for your local node.  To grant remote nodes access, just ftp your
 1170 ~/.Xauthority file (server machine) to your remote home directory.  There
 1171 are some notes on setting this up in the file Xauthority in the doc
 1172 directory.
 1174 I know from experience that setting up and using xauth security can be
 1175 a major pain in the neck.  For example, a site that's basically secure
 1176 can be configured by the system manager to enable xhost access to all
 1177 local nodes automatically through the /etc/X0.hosts file.  At such sites
 1178 the users are unaccustomed to explicitly granting permission and on a
 1179 secure group of machines there's no real security risk.  HOWEVER, a user
 1180 may need to occasionally access an "outside" machine, and since you can't
 1181 mix xhost and xauth, you are hosed.  And compiling TK without xauth
 1182 security is a gargantuan, tremendous security hazard.  A sickeningly vile,
 1183 disgusting mess.
 1185 Therefore I recommend that if you have any concerns about security or
 1186 problems with TK send, and ESPECIALLY if you are running from some remote
 1187 host, just forget about the TK driver altogether and use the DP driver
 1188 instead.  The DP driver uses a much superior method of communication
 1189 (sockets rather than X properties) and is distributable to boot.  It does
 1190 have a slightly longer startup time.  If you are running on a machine off
 1191 the network (where maybe you don't have a full TCP/IP implementation) the
 1192 TK driver is fine.  The DP driver only allows open connects between the
 1193 time it takes to launch the server and they do their initial handshaking,
 1194 a hole that I view as impossible to take advantage of.
 1197  4.3  How do I use the Tcl/TK driver?
 1199 Get it going with the example programs, and play with it.  Read the online
 1200 docs.
 1203  4.4  I've been having trouble getting the TK/TCL and PLplot working on
 1204 my Indigo running IRIX 4.0.5. I got TCL7.0 and TK3.3 as advised and built the
 1205 libraries and moved them to "/usr/lib" directory and then went about
 1206 (re)building PLplot. I then compiled the c-demos and ran them. The tk driver
 1207 would pop up a window and disappear with the following complaints...
 1208 ...
 1209 >>Starting up ./plserver
 1210 >>Server command "[list $plw_init $plwindow $client]" failed:
 1211 >>         remote interpreter did not respond
 1212 >>Program aborted
 1214 I think what is happening is that plserver is dumping core for some
 1215 reason.  So why don't you get a "core dumped" message?  It has something
 1216 to do with it being created through fork/exec from the TK driver.  Never
 1217 quite knew what, but now that I am thinking about it once again I bet I
 1218 know what the deal is.  It takes a little bit of time for it to dump core,
 1219 and in that time the sending interpreter in the TK driver times out, and
 1220 aborts.  Since the application is the parent process, once it exits you
 1221 don't see any pending messages that the plserver (child) has.  In this
 1222 circumstance I'm not sure if one should always get a core file or not.
 1224 So, the key is to find out why plserver is dumping core.  There are
 1225 a few things you can do.  When you built Tcl/TK, did you run the tests?
 1226 You need to type "make test" in either the tk3.3 or tcl7.0 directory, and
 1227 it will merrily go on its way.  After you have done that, try cd'ing to
 1228 the tk3.3/tests directory and running the tests using your installed
 1229 version of wish.  Some of the tests will fail because "make test" actually
 1230 compiles a custom version of wish with some extra functionality just for
 1231 the test suite.  But most of the tests will do ok.  If not, you hosed
 1232 the installation and that would explain the observed behavior.  If not
 1233 we need to do some more hunting.
 1235 Here are some more things to try: define DEBUG at the head of the files:
 1237 	plserver.c	(will give you information at startup)
 1238 	tk.c		(this does the launching of plserver)
 1240 This should tell you at the very least if plserver is getting started
 1241 correctly.  In addition, to get a whole LOT of output about the current
 1242 state of the code, you can define also DEBUG_ENTER in:
 1244 	plserver.c
 1245 	tk.c
 1247 and even:
 1248 	plframe.c (also define DEBUG here, but be ready for lots of output)
 1250 The resulting messages often prove useful.
 1253  4.5  I would like to issue a plot command, have the window appear,
 1254 or be re-painted, and allow the user to continue with command line operation
 1255 of RLaB. I would like the user to be able to resize the window at any time
 1256 or cover/un-cover it at any time and have it re-paint itself. The way  I
 1257 can get it to work is: the user issues plot command, window appears and is
 1258 resizable, etc... the user must use the 3rd mouse button to "release" the
 1259 window, after that control returns to the command line, but the window will
 1260 no longer resize/repaint.
 1262 This is a feature, not a bug :-).
 1264 When the plotting package is waiting for the user to advance the page, it
 1265 is actually waiting for any X event.  So events like refresh and resize
 1266 get intercepted and processed.
 1268 Also during the normal course of plotting, the X server is periodically
 1269 polled to find out if there are any events that need processing, and
 1270 handles them if so.  I don't do this on every graphics instruction because
 1271 otherwise the overhead is too large -- currently on every 20 line draws,
 1272 every 10 polyline draws, and on every other call.
 1274 But once the user signals for the page advance, and control is returned to
 1275 the user program, there is no way for the X driver to process any events
 1276 simply because the control is in your program, not in the X driver.  The
 1277 single-headedness of your process becomes the culprit here.  You can
 1278 either sit in an event loop, or be doing user code specific things, but
 1279 not both.  If you want to periodically tell the driver to handle pending
 1280 events, there is an escape function call for that, but it's really just a
 1281 bandaid solution.
 1283 The best solution is to fork off the rendering into a separate process,
 1284 and this is just what I did with the Tcl/TK driver.  So, if you select
 1285 the tk driver, your code can go about its merry way while the graphics
 1286 window can be refreshed, resized, zoomed, printed, dumped, or whatever.
 1288 It'd also be a worthwhile project to split the X driver similarly, and
 1289 there has been some interest in doing that (but I don't plan to work on
 1290 it).
 1293  4.6  The X driver seems to run slower than on older versions of PLplot.
 1295 This may be caused by writing into the pixmap.  Each instruction is
 1296 essentially done twice -- once to the screen and once to the offscreen
 1297 pixmap.  I'm not happy about the tradeoff but there's not much that can be
 1298 done.  With the pixmap, you get fast refreshes but slow draws, and the
 1299 other way around without it.  What made me decide on using a pixmap as the
 1300 default is the smooth scrolling that you can get (try a zoom followed by a
 1301 scroll in the TK driver -- without writing into a pixmap the scrolling
 1302 really sucks).  One way would be to write only to the pixmap and
 1303 occasionally blit it to the screen, but that would be jerky and you'd have
 1304 to worry about incomplete pages.  Try plotting with the -nopixmap option
 1305 to see if that's any better.  I do almost all my PLplot X development on
 1306 an HP 720 color console and graphics speed is usually not a problem :-).
 1309  4.7  How do I change the title on the TK window menu bar, i.e.,
 1311 >   Plot >> plclient_#2
 1312 >
 1313 >            ^^^^
 1314 >            I'd like this to read SuperCode
 1316 It uses the name of the main window if nothing else is set.  You can set
 1317 it two ways.  One, use plparseopts to parse your command line, then it
 1318 will use argv[0] out of that list.  Two, just glom pls->program directly,
 1319 via:
 1321 #include <plstream.h>
 1323 PLStream *pls;
 1325 ...
 1327     plgpls(&pls);
 1328     pls->program = "myprogram";
 1330 Yes, by this method you have access to the complete internal state of
 1331 the current PLplot stream.  So be careful what you change :-).
 1333 There is one catch, though.  The way it is set up now it must be a unique
 1334 name when using the Tk driver (but not the DP driver) since it corresponds
 1335 to your main window name (to which X property messages are sent).  If
 1336 there is a previous Tcl interpreter of that name hanging around (say, as a
 1337 result of some sort of abnormal exit like a core dump) you will get the
 1338 mysterious _#2 appended (and _#3, and so on; note there are utilities
 1339 [zapinterps or delinterp] that will delete these zombie interpreters).
 1342 -4.8  How do I run plserver as a daemon?
 1344 > What would be really desirable, would be to make plserver into an
 1345 > actual daemon, as described in Stevens UNP.  Very cool idea, how
 1346 > daemons work.  The plan would be to have a guy sitting there
 1347 > monitoring a port/pipe/whatever, and when a connection request comes
 1348 > in, he forks, and calls back to the app with directives to use a new,
 1349 > previously unused (or reclaimed) port.  Then the daemon goes back to
 1350 > listening.  That way, you could run multiple apps simultaneously, each
 1351 > getting a new plserver if a spare one isn't already available...
 1352 >
 1353 > I think the default action would be that when you punch >> on the last
 1354 > plot, the client goes ahead and terminates, but plserver stays up, for
 1355 > future invocations.  But when the user wants to get rid of it, if he
 1356 > doesn't plan to plot for a while, then there's a kill/off button
 1357 > somewhere on the pannel.
 1359 Actually it is possible now to start up a plserver and connect to it,
 1360 using the DP driver.  But one of the problems with this is the security
 1361 issue.  I get around the problem now by only allowing connects during
 1362 the brief time between the fork/exec and when the connection succeeds.
 1363 If it was open for longer we run into the same old possibility for
 1364 nasty interpreter commands being sent.  Dunno if there's a good way
 1365 around this.
 1368  4.9  Problems printing from the Tk driver..
 1370 > We're having some big problems with the latest release of PLPLOT.
 1371 > Basically, we can't print and we can't save Postscript files. When we
 1372 > try to print we get
 1373 >
 1374 > *** PLPLOT ERROR ***
 1375 > process_next: Unrecognized command
 1376 > Program aborted
 1377 > lpr: standard input: empty input file
 1379 Interesting.  Sounds like maybe an incompatibility with the plplot library
 1380 output and plrender [note: turns out it was indeed a previous version of
 1381 plrender in the user's search path].  The 'print' command saves the page
 1382 as a plplot metafile, and then invokes plrender to turn it into
 1383 postscript.  Either it was installed incorrectly, or (more likely), it is
 1384 a bug.  I have printed plots by this method without problem since the
 1385 4.99g release, but probably I didn't exercise everything.  Maybe try "Save
 1386 As.." with a variety of file types and see if anything turns out.
 1388 > I have my PRINTER environment variable set. Am I supposed to do
 1389 > something else?  As for saving Postscript files, it seems to write part
 1390 > of the file and then just stop in the middle. It appears that some
 1391 > buffer is not getting flushed.  Any ideas?
 1393 Take a look at the plpr script, it is braindead, but I never had much time
 1394 to embellish it.  It doesn't allow you to set a particular printer, which
 1395 I guess is what you want.  You can always edit the file, for site-wise
 1396 customization.  Of course, this sucks, but is the best I have for now.
 1397 Isn't "lpr" supposed to obey the setting of PRINTER?  Even if so/not,
 1398 there's the question of how to render the saved metafile.  I use mono ps,
 1399 since that's usually what people want.  But sometimes I've wanted to print
 1400 grayscale output, and hit print without thinking, and got a nice,
 1401 completely black, plot. :-) So not only do I have to provide for a way to
 1402 select this in the GUI but also a way to read customized settings
 1403 automatically at startup.  Which brings up init file issues.. (see the
 1404 ToDo file).
 1406 So for now just modify plpr to your tastes and stick it in your path :-).
 1407 It should be located BEFORE the installed copy of plpr, which should just
 1408 be the site-wise default.  I usually have ~/bin before most significant
 1409 directories in my path anyway.  The exec() call used to invoke it does use
 1410 your path I believe.  And if you embellish it significantly, feel free to
 1411 send me a copy.
 1414  4.10 Problems compiling xwin.c...
 1416 > I am trying to install PLPLOT on a DECstation 5000/240 running Ultrix
 1417 > 4.2a and an earlier version of X11R4. I am using gcc with the -ansi
 1418 > option.  Running make gives me the following errors:
 1419 >
 1420 > In file included from xwin.c:50:
 1421 > /usr/local/lib/gcc-lib/decstation-ultrix4.2a/2.4.5/include/X11/Xlib.h:3958: parse error before `XSizeHints'
 1423 After poking around some on this system I found out that the header files
 1424 were hosed.  This is the kind of thing that crops up only when using an
 1425 ANSI compiler or C++ since it's in the function prototypes.  In
 1426 particular, Xlib.h uses XSizeHints before it's defined (in Xutil.h).  In
 1427 the X11R5 header files from HP-UX, all of the functions needing to
 1428 reference a variable of type XSizeHints* are prototyped in Xutil.h, after
 1429 the declaration of XSizeHints.
 1431 I don't know how many systems I've seen with broken X11R4 header files --
 1432 a lot.  Seems the X11R4 distribution was partly to blame, but you'd think
 1433 the vendor would have at least checked to see whether an ANSI C compiler
 1434 would work with them.  In any case, there /should/ be an upgrade to fix
 1435 problems like this.  At worst, you can pull over a later X11 distribution
 1436 (as I write this X11R6 just came out) and build it yourself.  I do know
 1437 that some PLplot runs OK on some Ultrix systems so there should be an
 1438 upgrade available.
 1441  4.11 Problems saving files from the Tk driver.
 1443 > When I tried to save
 1444 > the .ps files (both color and mono) using "Save as.." in plrender,
 1445 > it doesn't seem to terminate the file properly. I had to add a
 1446 > "showpage" statement at the end before I send it to the printer
 1447 > in order for my printer to print it properly. On the other hand, if
 1448 > I select the drivers (ps or psc) at the command line or upon start
 1449 > of the program, the output files looked fine.
 1451 You either need to quit the program or pick "save close" before displaying
 1452 the saved file.  This is because "save as" leaves the file open so that
 1453 you can use "save" on multiple plots, each going to the same file.
 1456 +4.12 Why does the Tcl/TK driver use a separate process for rendering but
 1457       not the X driver?
 1459 > The pgplot xwin driver forks a separate process to handle expose and other
 1460 > events, and this works fine under SunOS 4.3.1 but fails under AIX 3.2.5 (and
 1461 > I hear under other similar systems like Solaris 2). In your own code, you
 1462 > seem to keep event handling inside the other routines, and periodically you
 1463 > deal with the queue. Is that correct? Can you tell me a bit about the
 1464 > philosophy behind the routines, and why such careful housekeeping is
 1465 > necessary?
 1467 Forking it off as a separate process is much better, in principle.  The
 1468 xwin driver was contributed; I took it and improved it greatly and learned
 1469 a lot about X by experimenting with it.  I eventually wrote the Tk/Tcl-DP
 1470 driver(s), in which the rendering /is/ split off into a separate process.
 1471 The PLplot OS/2 driver written by Geoff Furnish works by similar
 1472 principles, but uses threads (something that more Unix systems should
 1473 support).  And, the Tk/DP drivers /do/ work under AIX, SunOS-4x, Solaris,
 1474 HPUX, Linux, Unicos, IRIX, OSF/1, etc.  I have become a bit of a
 1475 portability expert and what I don't have experience on, the users of
 1476 PLplot contribute (plus I've been working really hard on getting the
 1477 package as portable as is reasonable).  Nevertheless, the existing xwin
 1478 driver with its simpler paradigm (polling, rather than communication with
 1479 an external event-driven process) serves as a useful base level X driver.
 1480 There are definitely MANY more software and portability issues involved in
 1481 the separate process route.
 1484 +4.13 How do I create an interactive, widget-based application using PLplot?
 1486 > I would like to make an interactive widget so that the plot can be
 1487 > interactively changed by clicking and dragging on the plot.
 1489 Direct control of the plframe widget, or even better, the plxframe
 1490 "megawidget", is the way to go.
 1492 One problem: plxframe is not a true megawidget.  At the time of this
 1493 writing, there are few good ways to do this in straight Tcl, and I haven't
 1494 yet committed to rewriting the code in [incr Tcl].  I probably will
 1495 eventually, though, to make the plxframe truly controllable and robust.
 1496 Right now it's just a collection of Tcl procs that work together to
 1497 control a plframe.
 1499 Another problem: you have to do practically all the plot control from a high
 1500 level.  Graphical objects in the PLplot/tk interface are not objectized so
 1501 there are few low-level operations the user has access to.
 1503 The graphics representation in the plframe widget is just a bitmap.  I plan
 1504 to gradually raise the abstraction level up in order to make the package
 1505 more useful.  E.g. instead of a bunch of vector strokes, a character string
 1506 will be represented as a data structure, which only becomes vector strokes
 1507 when it gets to the driver.  That way the user can change its attributes;
 1508 most notably, the postscript font that is used to print it when sending the
 1509 plot through the ps driver.  Also something similar could be done with
 1510 color.  But these capabilities are a long way off and will be added very
 1511 conservatively.
 1513 BTW, a Tk canvas has good support for manipulating its components (at a
 1514 price).
 1516 Now back to the high level way of doing it.  You can intercept keystrokes or
 1517 mouse clicks in Tk very easily using the "bind" command (Tcl API).  You can
 1518 set up an event handler that interprets the appropriate actions by the user
 1519 as commands to the plot library.  There are ways to return the world
 1520 coordinates of the cursor as well (a plframe widget command and API call),
 1521 which is important in controlling what gets done.
 1523 Each time the plot must be changed it would have to be redrawn.  This is not
 1524 unreasonable on today's killer micros or fast workstations.  In fact, the
 1525 scrolling you can do after a zoom is accomplished not by scrolling around in
 1526 some super bitmap but by redrawing the visible area of the plot each time
 1527 (it is buffered so that it appears smooth).  How well this works is a
 1528 function of the speed of your machine.  On my HP 720, scrolling simple line
 1529 plots (e.g. x01c) in zoom mode is quite fast.  Shaded plots are much slower.
 1530 And any routine that needs to do significant calculation (such as the
 1531 contour plotters) will be kind of slow to redraw.
 1534 +4.14 How do I shade between a 4 color range with the Tk driver?
 1536 The easiest way to experiment is to use the load palette option.
 1537 The last distribution came with some alternate choices -- cmap1a.pal
 1538 is the default, so try cmap1b.pal and cmap1c.pal.  And since they
 1539 are ASCII, it's trivial to create new ones.  Here's cmap1c.pal:
 1540 -----------cut-----------
 1541 6
 1542 #ff00ff 00
 1543 #0080ff 20
 1544 #00ffff 44
 1545 #00ff90 54
 1546 #fffb00 67
 1547 #ff0000 100
 1548 -----------cut-----------
 1550 The first number is the number of control points, and each control point is
 1551 set subsequently.  The first line after the '6' above is for the first
 1552 control point, and so on to the 6th.  The first number is the color in
 1553 hex, and the second number is the location in cmap1-space the control point
 1554 resides.  There is an optional third number, a boolean (0 or 1), that
 1555 results in the interpolation going "around the back" of the hue wheel
 1556 if set.  There is also an API function for setting control points.
 1559 ==============================================================================
 1560 Section 5: All other drivers & supported platforms
 1561 ==============================================================================
 1563  5.1  What about support for platform..
 1565 Right now the package is most likely to be up-to-date under HP-UX and
 1566 Linux, since those are the two systems used most extensively by Maurice
 1567 and Geoff.  However we also use SunOS, AIX, UNICOS, and SUPER-UX enough
 1568 that probably there will be no problems on those systems also.  The DOS
 1569 and OS/2 support is being done mostly by other parties at this point (see
 1570 the README).  Any other systems are suspect.  Other Unix variants (IRIX,
 1571 OSF/1) are reasonably safe since the PLplot configure script is fairly
 1572 sophisticated and portable -- system dependencies tend to drop out without
 1573 notice.  I can't make any promises as to the Amiga support since I rarely
 1574 compile PLplot there these days.  Also no one is currently supporting the
 1575 NeXT.  As always, I'm looking for volunteers to help pick up the slack on
 1576 these systems (really, any other than say HPUX and Linux).  At the minimum
 1577 this means getting pre-beta releases and testing them, submitting any
 1578 fixes that need to be made, that's it!  If you have more ambitious plans
 1579 for supporting a particular platform, that'd be great -- let me know.
 1582 =5.2  What about PLplot support for VMS?
 1584 PLplot under VMS is now supported, thanks to the efforts of Hiromi Kimura
 1585 (hiromi@tac.tsukuba.ac.jp).  See the files in sys/vms.
 1588  5.3  PLplot is aborting with: Error opening plot data storage file.
 1590 The most common reason I've seen for this is that the temporary file area
 1591 is set up incorrectly (wrong permissions).  Note: this directory is where
 1592 tmpfile() opens its temporaries, which may NOT be /tmp.  You can find the
 1593 true location typically by looking in stdio.h.  For example, on my HP
 1594 in stdio.h there is:
 1596 #  define _P_tmpdir "/usr/tmp/"
 1598 look for something similar on your machine, and make sure the directory
 1599 has the appropriate permissions (it should have global write set).
 1602  5.4  Is there a Windows port of PLplot?
 1604 Look under sys/dos/bcc, there you'll see a file win3.c, which is a Windows
 1605 port by Paul Casteels.  I don't know much about it having never tried it,
 1606 but have heard some good comments about it.  One nice enhancement is the
 1607 ability to print the current plot.
 1610 +5.5  I'd like to develop a windowed interface to PLplot for..
 1612 For the systems that I've used, developing windowed interfaces is a fair
 1613 amount of work.  Most of my experience developing graphical interfaces is
 1614 under Unix (and a little on the Amiga).  Unix/X/Tcl/Tk on a fast
 1615 workstation makes for an excellent starting point -- it is powerful, and
 1616 the final product is fairly portable.  Virtually all my professional work
 1617 is on Unix machines, which also drives my effort -- the Tk driver is where
 1618 most of my attention has been going.  But it's still a /lot/ of work.
 1620 Of course there are still many reasons for using or developing on a
 1621 microcomputer -- if I used my Amiga more I'd be more inclined to spend
 1622 more time improving the interface there.  As it was, the Amiga had the
 1623 first PLplot windowed interface, and it gave me many ideas about how to
 1624 proceed with the Tk one.  Unfortunately, too many of these features were
 1625 built into the Amiga screen driver instead of the core, and didn't help
 1626 directly when I was doing the Tk driver.  So when I improved the package
 1627 in order to support the Tk driver I tried to make changes where they could
 1628 potentially benefit other windowing drivers.  This should help developers
 1629 of other windowed drivers some.
 1631 I originally started developing a Motif-based driver (in C), but abandoned
 1632 the effort when I saw how much easier Tk-based ones (in Tcl and C) are to
 1633 construct.  Tk is free to boot.  So at this point I'm very happy with Tcl/TK
 1634 and am probably finished with Motif.  There are still some reasons for going
 1635 with Motif -- such as needing a specific Motif widget or to satisfy company
 1636 policy, market demand, or whatever.  Also the recent development of
 1637 interpretive Motif environments that rival Tcl/TK in their ease of use and
 1638 prototyping speed (or so I've heard) makes Motif-based GUI construction more
 1639 palatable.  If you just want Motif widgets inside your app, you can do this
 1640 in Tk (see the comp.lang.tcl FAQ for more info).  Right now there is no way
 1641 to do the reverse as far as I know -- include Tk widgets inside a Motif app,
 1642 but maybe eventually there will be a way (I mention this because the
 1643 development of the plframe widget was the most time-consuming single thing
 1644 I've done as regards PLplot).
 1646 Under Windows, try the driver by Paul Casteels (see FAQ 5.4).  At the time
 1647 of this writing it is still somewhat sparse, but as per the comments above
 1648 it may not be unreasonable to extend it in the same directions as the Tk
 1649 driver.  Another alternative is to actually use Tk -- there are several
 1650 ports of Tk to Windows in various stages of completion.  I'd like to hear
 1651 about people's experiences with these, especially with PLplot.
 1654 +5.6  What about PLplot support for the Mac?
 1656 I've been asked several times about a Mac interface.  There is now a
 1657 Mac driver!  It needs someone to "adopt" it, i.e. keep it up to date,
 1658 answer questions about it, etc.  Email mjl@dino.ph.utexas.edu if you
 1659 want the job.  Otherwise it probably will end up broken sooner or later.
 1661 (Ian Searle writes:) Tzong-Shuoh Yang (tsyang@ce.berkeley.edu) has been
 1662 doing the RLaB Macintosh port for at least a year now (RLaB uses Plplot for
 1663 graphics).  Plplot works quite nicely on the Mac.
 1666 +5.7  What about PLplot support for OS/2?
 1668 >The stuff in sys/os2 worked under OS/2 1.3.  There is a port of that
 1669 >code to OS/2 2.x underway by another person, but I'm not sure of the
 1670 >current status of that port.  Presumably eventually PLplot will once
 1671 >again have OS/2 PM support, but there is no ETA.  You should be able
 1672 >to build PLplot to use file oriented drivers without difficulty.  Emx
 1673 >should be fine for that.
 1675 (John C. Peterson, KD6EKQ, {smart-host}!octagon!jcp,
 1676 jcp%octagon.UUCP@ucsd.edu writes:) That person would be me!  And, your
 1677 statement is correct, the only real "hitch" is the Presentation Manager
 1678 driver, a very desirable one to have of course. I've made pretty good
 1679 progress on the OS/2 port of the PM stuff using GCC/EMX. I've got all the
 1680 Presentation Manager and other APIs converted over to their 32 bit
 1681 equivalents.  It compiles cleanly under EMX without any "quibbling". At the
 1682 moment, there *are* a few bugs that need to be hunted down, about 1/2 of the
 1683 C examples fail to run correctly (or at all!) Most of this is because of
 1684 subtle changes to the design of the PLplot driver interface that have
 1685 occurred during the last couple years, during which time the driver was not
 1686 been updated.
 1688    Unfortunately, I haven't had any time to work on it over the last
 1689 several months.  I've been very busy at my regular job for the last 4-5
 1690 months, working out of town for about 2 of those months. I tried to
 1691 recruit some help for this effort through the Usenet OS/2 groups, but
 1692 came up empty.  There is hope though, the big crunch at work is finally
 1693 behind me, and as soon as I get caught up with personal things, I hope
 1694 to get back to working on the port.
 1696 ==============================================================================