How to rotate y-axis label in LaTex output

View: New views
6 Messages — Rating Filter:   Alert me  

How to rotate y-axis label in LaTex output

by LukasP :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I use GNUPlot to process some data files into LaTeX input file.

I'd like to describe the y-axis with some text. In GNUPlot, the text is rotated 90 degrees, that's OK. But not in LaTeX input.

How to achieve the y-axis label rotation as well?

There some files attached to demonstrate the problem.

Thank you in advance.

Lukas

Prob.zip

Re: How to rotate y-axis label in LaTex output

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

set ylabel "\\rotatebox{90}{ylabel}"

and add
\usepackage{graphicx}
to your tex file header.

LukasP wrote:
Hello,

I use GNUPlot to process some data files into LaTeX input file.

I'd like to describe the y-axis with some text. In GNUPlot, the text is rotated 90 degrees, that's OK. But not in LaTeX input.

How to achieve the y-axis label rotation as well?

There some files attached to demonstrate the problem.

Thank you in advance.

Lukas

Prob.zip

Re: How to rotate y-axis label in LaTex output

by LukasP :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

... OK, this would work.

But it means to have two different y-labels when viewing in gnuplot and when using "set terminal latex".

Wouldn't be better gnuplot to use \rotatebox[angle=90]{} automatically when "set terminal latex" is active?

Shall I treat it as "gnuplot feature request" - to post it to the appropriate mail list?

Lukas

Thomas Sefzick wrote:
set ylabel "\\rotatebox{90}{ylabel}"

Re: How to rotate y-axis label in LaTex output

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

LukasP wrote:
... OK, this would work.

But it means to have two different y-labels when viewing in gnuplot
and when using "set terminal latex".
yes

LukasP wrote:
Wouldn't be better gnuplot to use \rotatebox[angle=90]{} automatically
when "set terminal latex" is active?
this would break compatibility with existing plot scripts relying on the
behaviour of the 'latex' terminal that a ylabel like "a\\\\b\\\\c" is
printed 'shortstacked' (i.e. one character below the other).

the 'latex' terminal code was written when the 'graphics' or 'graphicx'
packages weren't established (or even existing?).

what could be done is to introduce a 'rotate' option to the
'latex' terminal and when this option is activated use the
'\rotatebox' command (and provide a test in the latex file
to test for the existence of the 'graphics' or 'graphicx' package).

but then the question would arise if it wouldn't be better to
use the 'epslatex' terminal which does this ylabel rotation
automatically and produces a far better plot because postscript
isn't restricted to the limited graphics capabilities of latex's
'picture' environment.

Re: How to rotate y-axis label in LaTex output

by LukasP :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, I understand keeping backward compatibility.

Best "set terminal latex yrotate" (or something) seems to me, as there are problems including .eps by pdfLaTex (no problem with pdfTeX).

There is also a problem with diacritics (I'm using WinXP, pdfLaTex, czech language) - the same in .eps, .png and .jpg. (I tried all these formats.)

So if I created labels without diacritics, a .png or .jpg would be a good alternative. But now I needed "staničení" (= chainage in english).

Do you think I should put "set terminal latex yrotate" somewhere as a wanted feature/enhancement?

Thomas Sefzick wrote:
what could be done is to introduce a 'rotate' option to the
'latex' terminal and when this option is activated use the
'\rotatebox' command (and provide a test in the latex file
to test for the existence of the 'graphics' or 'graphicx' package).

Re: How to rotate y-axis label in LaTex output

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i submitted a simple patch to sourceforge:
http://sourceforge.net/tracker/?group_id=2055&atid=302055


OK, I understand keeping backward compatibility.

Best "set terminal latex yrotate" (or something) seems to me, as there are problems including .eps by pdfLaTex (no problem with pdfTeX).

There is also a problem with diacritics (I'm using WinXP, pdfLaTex, czech language) - the same in .eps, .png and .jpg. (I tried all these formats.)

So if I created labels without diacritics, a .png or .jpg would be a good alternative. But now I needed "staničení" (= chainage in english).

Do you think I should put "set terminal latex yrotate" somewhere as a wanted feature/enhancement?

Thomas Sefzick wrote:
what could be done is to introduce a 'rotate' option to the
'latex' terminal and when this option is activated use the
'\rotatebox' command (and provide a test in the latex file
to test for the existence of the 'graphics' or 'graphicx' package).