Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xtics offset : closing the gap between label and axis

3,125 views
Skip to first unread message

bryan

unread,
Nov 3, 2010, 4:12:06 PM11/3/10
to
[ gnuplot 4.4 patchlevel 0 ]
[ Ubuntu GNU/Linux 10.10-ish ]
[ pdfjam 2.05 ]

i'd like to "close the gap" between the xlabels - which are varying
lengths of text - in a data file - and the xaxis. i am trying to do
this with xtics:offset as follows :

set xtics scale 0 nomirror offset 0,-7.5 rotate by 90
data file entry (keeping it simple):

1 1.234 0.235 "this is a very very very long label"
1 3.244 1.005 "short"

... trying a diagram here - i flip the whole thing 90 degrees -
hopefully makes sense - so instead of output like this :

this is a very very very long label |
short |
+---------------

i want :

this is a very very very long label |
short |
+---------------

i can sort of get this if i do various tricks, but more likely is i'm
not using xtics right.

sfeam

unread,
Nov 3, 2010, 4:57:26 PM11/3/10
to
bryan wrote:

Hi Bryan,

I think the style you want is already the default :-)

Try:
set xtics scale 0 nomirror rotate


Note no extra rotation angle is given and no offset is specified.
If that's not right, then maybe I misunderstand which way you are
flipping the final figure.

Ethan

bryan

unread,
Nov 3, 2010, 5:32:43 PM11/3/10
to
On Nov 3, 4:57 pm, sfeam <sf...@users.sourceforge.net> wrote:
> maybe I misunderstand which way you are
> flipping the final figure.

basically, histogram in gnuplot->postscript->pdf90. that rotates the
default histogram so the xtic labels read left-to-right. this is a
mess to diagram in plaintext here. basically

_| ->rotate 90deg cw-> |_

after the rotation, the labels appear "left justified". i want "right
justified".

> Try:
>    set xtics scale 0 nomirror rotate

this has the labels running into the plot area.

then there's always the gimp

-bryan

p.s: took me a while to decode "sfeam" ;^)

sfeam

unread,
Nov 3, 2010, 9:05:22 PM11/3/10
to
bryan wrote:

> On Nov 3, 4:57 pm, sfeam <sf...@users.sourceforge.net> wrote:
>> maybe I misunderstand which way you are
>> flipping the final figure.
>
> basically, histogram in gnuplot->postscript->pdf90. that rotates the
> default histogram so the xtic labels read left-to-right. this is a
> mess to diagram in plaintext here. basically
>
> _| ->rotate 90deg cw-> |_
>
> after the rotation, the labels appear "left justified". i want "right
> justified".
>
>> Try:
>> set xtics scale 0 nomirror rotate
>
> this has the labels running into the plot area.

Really? Not when I try it here.

Sounds like we need more information.
What terminal? What font selection?
Is right-justified text working in the output from "test"?

Ethan

bryan

unread,
Nov 5, 2010, 11:17:13 AM11/5/10
to
> >> set xtics scale 0 nomirror rotate
>
> > this has the labels running into the plot area.
>
> Really?  Not when I try it here.
> Sounds like we need more information.
> What terminal?  

i tried 'wxt', 'postscript color enhanced', and 'xterm'

> What font selection?

"Arial" fontfile 'Arial.pfa', though the defaults do this too.

> Is right-justified text working in the output from "test"?

yes it is - that was handy.

i tried to make a copy/paste example without confusing it with plot
rotation. i think that means the notion of "justified" is meaningless
here - then, its just about the gap between xaxis and xtic (IIUC! -
see after for input data) :

# c/p into terminal :
gnuplot
OffsetFactor=-7.5 ; \
reset ; set xrange [0:7] ; set xtics scale 0 nomirror offset
0,OffsetFactor rotate by 90 ; \
set key left top ; unset label ; xbar=1 ; sigma=0.2 ; set border 9 ; \
set style histogram clustered gap 1 title offset 0,0 ; set boxwidth
0.4 ; \
set xlabel "" ; set datafile missing '-' ; set xlabel "xlabel" ; set
ylabel "ylabel" ; \
set style fill solid border -1 ; \
plot \
for [i=0:5] 'data_3.dat' u 1:2:3:xticlabel(4) every ::i w boxerror
fill empty notitle lw 2 lc -1

data_3.dat :

1 1.0 0.600 "Xtic" "+"
2 1.0 0.500 "XticXtic" "o"
3 1.0 0.400 "XticXticXtic" "++"
4 1.0 0.300 "XticXticXticXtic" "+++"
5 1.0 0.200 "XticXticXticXticXtic" "++++"
6 1.0 0.100 "XticXticXticXticXticXtic" "+++++"

sfeam

unread,
Nov 6, 2010, 1:08:28 PM11/6/10
to
bryan wrote:

But that script overrides the default positioning, which I still think
is what you want.

Replace "set xtics scale 0 nomirror offset 0,OffsetFactor rotate by 90"
with "set xtics scale 0 nomirror rotate"

Ethan

bryan

unread,
Nov 7, 2010, 8:40:39 AM11/7/10
to
> But that script overrides the default positioning, which I still think is what you want.
>
> Replace "set xtics scale 0 nomirror offset 0,OffsetFactor rotate by 90"
> with    "set xtics scale 0 nomirror rotate"

ohhhh - now i see - that did it!

thanks!

-Bryan

0 new messages