|
From: Jérôme L. <lod...@us...> - 2014-10-25 21:41:50
|
Le 25/10/2014 22:26, Philipp K. Janert a écrit : > I guess the question then becomes: in what form is > the graph information is available "when the button > is pressed". > > Not knowing the code, I could guess that what is > copied to the clipboard (currently) is only the > already-rendered bitmap. No way to construct a > meaningful vector graphic from that! > > The implication seems to be that the "save as file" > GUI event would have to interact more deeply with > gnuplot's internals: it actually has to go back, get > the data set (and all that) and recreate the plot, > basically from scratch, just using a different backend. > > That's different and more complicated than saving an > already rendered bitmap to the clipboard. I had not > appreciated that difficulty sufficiently! (Too bad.) As Bastian said before, the Qt terminal has always had the functionality you are discussing. Its window features an "export as" button, which supports png, svg and pdf. In fact, the Qt terminal remembers every single graphics primitive it receives from gnuplot and is able to render them as a bitmap (on screen, to the clipboard, to a png file) or as a vector graphics (svg, pdf). Because it uses the "QGraphicsScene" feature of Qt, supporting all these options takes no more than a few lines of codes. Jérôme |