|
From: Dieter J. <die...@t-...> - 2008-12-18 20:30:47
|
Dear listmembers,
I frequently use gnuplot for my graphs in conjunction with the postscript
terminal. However, there is one thing that drives me nuts someone might have
an idea on how to help me with.
My prerequisite is the postscript terminal. I haven't tested on other
terminals and I expect any terminal to exhibit a very similar behaviour, the
quality of the outcome of the commands that follow now will vary in a wide
range.
Assume you want to have an axis label and an arrow along the axes, you can do:
set xlabel "t/s"
set ylabel "U/V"
set arrow 1 filled size graph 0.035,8 from graph -0.12,0.55 to \
graph -0.12,0.8
set arrow 2 filled size graph 0.035,8 from graph 0.55,-0.12 to \
graph 0.72,-0.12
The problem arises now that the label and the label text may be in an
appropriate position relative to each other, but in general they will not.
This depends on the font you are using, on the axis text format (i. e.
whether the highest number is 1 or 1000) and so on and so forth.
Therefore one needs to check the positions after each plot and one is forced
to play with the numbers / give a little more / give a little less - an
interative procedure.
One possible improvement is to use the following structure:
XPOS=-0.12
YPOS=-0.08
# The next two lines are mandatory. If they do not exist, the graph's limits
# do not extend across the axis numbering, so there would be no room for an
# actual label.
set xlabel " " # blank is required!
set ylabel " " # blank is required!
set label 1 "t/s" at graph 0.5,YPOS
set label 2 "U/V" rotate by 90 at graph XPOS,0.5
set arrow 1 filled size graph 0.035,8 from graph -XPOS,0.55 to graph XPOS,0.8
set arrow 2 filled size graph 0.035,8 from graph 0.55,YPOS to graph 0.72,YPOS
This will ensure that text and arrows are in the correct relative position to
each other (besides a possible x-shift for the x-arrow and a possible y-shift
for the y-arrow. However, the position relative to the axis needs to be
rechecked and highly probable needs to be adjusted.
The improvement here is that you only change one number at one place to
influence all relevant parameters.
Is there any chance to get an information about the y-position of the x-label
and the x-position of the y-label in order to reduce the effort if one wants
to put label-arrows along the axis?
Nicest would be, say (my dream, indeed)
set xlabelarrow filled size graph 0.035,8 {offset {graph} <OFFSET>} length \
graph 0.2
set ylabelarrow filled size graph 0.035,8 {offset {graph} <OFFSET>} length \
graph 0.2
and the xlabelarrow would start right of the xlabel and would be centered to
it in y-position and the ylabelarrow would start above of the ylabel and
would be centered to it in x-position. But this is just a dream, I know.
Nevertheless, maybe someone knows a better approach that could simplify the
efforts required to get this done. This exceeds far beyond my programming
capabilities.
Thank you _very_ much for looking into this, thank you for working on gnuplot!
Take care
Dieter Jurzitza
--
-----------------------------------------------------------
|
\
/\_/\ |
| ~x~ |/-----\ /
\ /- \_/
^^__ _ / _ ____ /
<°°__ \- \_/ | |/ | |
|| || _| _| _| _|
if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------
|