|
From: <pl...@pi...> - 2009-06-03 21:15:58
|
Ethan Merritt wrote: > On Tuesday 02 June 2009, James R. Van Zandt wrote: > > [snipped most of it] > >> Ethan Merritt wrote: >>>> + how to pass the transform to an external helper (gnuplot_x11) or wrap it >>>> in the driver output (canvas terminal)? >> Surely that interface, in both directions, can be in terminal coordinates? > > The issue is clearest for the canvas terminal, where "both directions" does not > apply. I want to toggle between linear/logscale or linear/transform in the > javascript code on the browser. There is no back-connection to the original > gnuplot run. > > I am arguing that it may be preferable to send terminal coordinates corresponding > to linear scale, plus some clue how they should be transformed by the viewer > upon request. > > Right now the output from gnuplot is in terminal coordinates that represent either > linear or log scale depending upon what was set at the time the plot was created. > The routine gnuplot_mouse.js knows how to back-transform the stored terminal > coordinates to give back correct mousing if log-scale was in effect. > But it doesn't know how to toggle from linear to log display of the coordinates, > whatever scale they were originally on. It wouldn't be very hard to add that, > just tedious. I was putting it off in the hope that we might come up with a general > plan for toggling transformed data, so that I could write the routines only once > instead of having to redo them later. > > > ------ Hi, I'm wondering about the rationality of this. "Toggling" log/transform scaling is really a euphormism for a total replot it seems. You fundementally change the x or y scale transformation and have to do a full replot of the data, axes and all. This is feasible in a live terminal such as wxt since gnuplot is available to do the replotting. In the case of write-once interactive terminals I see two possibilities: 1/ export two renditions of the graph and a trivial js routine to toggle them. This could be similar to the line visibility toggle already working for svg but on a larger object. I suspect the coding would be trivial and fairly portable. I doubt that the amount of information that would be common to both plots would merit swapping only part of the content. Gnuplot should provide complete plots and just let the browser toggle visibility. This approach should be valid for any arbitary future tranformations. or 2/ export enough information and js code for the interactive terminal to redraw new axes, tic labels , grid, plot lines, axes labels and possibily alter the legend. It seems that this close to the entire plot job except parsing the input data. It is reproducing most of what gnuplot would do. Gnuplot is no longer a plotter but a preprocessor. This seems rather off target in terms of what gnuplot should be doing. /Peter. |