|
From: Daniel J S. <dan...@ie...> - 2003-10-31 01:11:23
|
Folks, I've updated some patches on SourceForge (with much of Petr's help) that I'd like people to test and consider for integration into Gnuplot. One is a moderate length patch for unlimited X11 windows. The other is the longer patch for image and binary data file support. I will briefly discuss the two in separate emails... Patch 774822 Unlimited plot windows for X11 terminals. linked_list_103003.diff The unlimited X11 windows patch consists of the one file listed above. The strategy here was to take the large table containing information about the window and add a few pointers for a doubly-linked list and an identifier (the window #). Then there is a large chunk of code to support the linked list. It actually is fairly straightforward with a few short routines like "Add_To_List", "Remove_From_List", etc. The only tricky part was robustly cleaning up plots that are deleted via the OS, e.g., pressing the close button of the window. That requires a queue for deleting plots because otherwise the OS error handler could delete a plot that gnuplot_x11 is currently accessing. In any case, it has been very robust and I can't recall ever seeing gnuplot_x11 go defunct with this strategy. I've also run this through Octave to generate a couple hundred plots on the screen and it works fine. So, in summary, the structure of 16 plots has been replaced by a linked list. Petr has tested the patch and also gave some good suggestions for additions. Also, the issue of closing a window has come up on the list, so I added a "close", although there may be an issue with the different pipes. (Try it, see if it suitable.) The X11_options() routine has been cleaned up to do reasonable sanity checks and to not change anything unless a valid "set term" command is entered. This is more in line with the manner in which "plot" and "splot" behave. There is documentation in Gnuplot, but some examples are set term x11 145 title "Hello World" plot sin(x) set term x11 close Dan -- Dan Sebald email: daniel . sebald @ ie ee . o rg URL: ht tp://acer-access.c om/~dsebald @ acer-access.c om/ |