|
From: swlab <sw...@co...> - 2005-01-18 17:57:43
|
Hello, I'm writing some templates, and I'd like to access some of the plot internal variables (eg, maximum and minimum of x values, as determined by an autoplot; R2 of a fit; automatic label offset ...). For example, in Gri, the maximum x value is stored in the internal variable .xright. (or eqvlt, I haven't checked), and it's pretty easy to use this value in some labels. Another application I have in mind is to align axes labels in a multiplot graph: aligning the axes is obvious, but I have to rely on trial/error to get axes labels on the same baseline Could anybody point me to some resources ? Thx in advance P. |
|
From: Hans-Bernhard B. <br...@ph...> - 2005-01-19 13:35:55
|
swlab wrote: > I'm writing some templates, and I'd like to access some of the plot internal > variables (eg, maximum and minimum of x values, as determined by an autoplot; > R2 of a fit; automatic label offset ...). That would be seriously difficult, given that for at least some plots, these values don't even exist other than during the execution of a 'plot' or 'splot' command. If you want to access those variables, I'm afraid the only sensible way is to do it the other way round: invent your own variable names for these, and issue commands to set the gnuplot state according to them, i.e. set xrange [my_xleft:my_xright] > Another application I have in mind is to align axes labels in a multiplot > graph: Align them --- to _what_? Have you read and understood 'help coordinates'? |
|
From: swlab <sw...@co...> - 2005-01-19 18:55:13
|
On Wednesday 19 January 2005 08:37, Hans-Bernhard Broeker wrote: > If you want to access those variables, I'm afraid the only sensible way > is to do it the other way round: invent your own variable names for > these, and issue commands to set the gnuplot state according to them, i.e. > set xrange [my_xleft:my_xright] OK, that's what I feared. The problem is that if I use predefined values for the range I lose gnuplot's capacity to define what the best range is (and frankly, I'm not keen writing some code that would badly replicate that....) So: new feature ? > > Another application I have in mind is to align axes labels in a multiplot > > graph: > > Align them --- to _what_? Have you read and understood 'help coordinates'? OK, one particular example should make it easier to understand. In a postscript term , I stack 3 plots vertically, same x size, different y sizes. The y axis title of the 1st plot is in Times 16, the two others in Times 12 (same for the tics). I align my 3 axes with lmargin. I want the axes titles to be aligned one with the other (ie, same vertical baseline). I can fiddle around with the x,y values in ylabel to get the title of plot #2 to bw aligned with plot #1, by trial and error. It's long, and not reproducible. So, I wondered at what distance from the y axis are the labels positioned by default (OK, I guess it depends on the terminal, on the font size....) ? Is there a better way to write axes titles on the page/screen ? |
|
From: Hans-Bernhard B. <br...@ph...> - 2005-01-19 19:15:03
|
swlab wrote: > On Wednesday 19 January 2005 08:37, Hans-Bernhard Broeker wrote: > OK, that's what I feared. The problem is that if I use predefined values for > the range I lose gnuplot's capacity to define what the best range is Yes. But that's inavoidable anyway, to at least some extent --- the "best range" found by gnuplot doesn't live long enough to be exported like that (well, setting aside the 'writeback' feature, that is...) [...] > OK, one particular example should make it easier to understand. > In a postscript term , I stack 3 plots vertically, same x size, different y > sizes. The y axis title of the 1st plot is in Times 16, the two others in > Times 12 (same for the tics). There's your problem. Keep the font sizes the same, and you could align them. If you don't, there's nothing left gnuplot can do for you, since the positioning offsets for axis labels are expressed in multiples of the font height / width (or rather: of what gnuplot believes those to be). |
|
From: swlab <sw...@co...> - 2005-01-19 21:16:02
|
> There's your problem. Keep the font sizes the same, and you could align > them. Pb if that of course, I can't (I would have done it already if I could ;) > If you don't, there's nothing left gnuplot can do for you, since > the positioning offsets for axis labels are expressed in multiples of > the font height / width (or rather: of what gnuplot believes those to be). Well, I guess I have to find what the formula is, and figure out a way to put it in script. HB, do you know where in the source I could find the info ? In another matter, it could be useful to have the internal variables defined while plotting stored somewhere after the plot is done, which would leave the possibility for the user to access them. A new feature ? Of course, I could use gri for postscript output... |
|
From: Hans-Bernhard B. <br...@ph...> - 2005-01-21 16:58:47
|
swlab wrote: >>If you don't, there's nothing left gnuplot can do for you, since >>the positioning offsets for axis labels are expressed in multiples of >>the font height / width (or rather: of what gnuplot believes those to be). > Well, I guess I have to find what the formula is, and figure out a way to put > it in script. HB, do you know where in the source I could find the info ? It's not just a simple formula, in the script. It's hardcoded into lots of bits and pieces, in functions boundary() and boundary_3d(), which are about the two biggest and messiest functions in all of gnuplot's source code. Definitely "Ye who enter here, let go of all hope" material. |