Quantcast

Titles cropped when x2tics labels are added

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Titles cropped when x2tics labels are added

Kevin Oberman
When I add labels above the plot (x2tics), my titles is cropped. There is a
great deal of space below the title.

Here is the setup:
set term gif font \"ariel,14\" size 1024, 600
set output "/usr/local/www/data/a_rain.gif"
set colors classic
set grid xtics ytics
set boxwidth 0.8 relative
set xlabel "Rainfall year is July 1 - June 30"
set ylabel "Inches"
set xrange [ 1996:2016 ]
set x2tics ($x2tics) font "ariel, 8"
set xtics ($xtics) font "ariel,8"
set title "Annual Rainfall" font "ariel,24"
plot "-" using 1:2 notitle with boxes fs solid lc rgb "black"

You can see the result at http://ykoberman.dlinkddns.com/a_rain.gif

I get similar results with other plots that include x2tic labels.

Any idea what is going on here?

Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: [hidden email]
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Titles cropped when x2tics labels are added

Ethan A Merritt-2
On Saturday, 12 November 2016 11:32:26 PM Kevin Oberman wrote:
> When I add labels above the plot (x2tics), my titles is cropped. There is a
> great deal of space below the title.

What is your exact version of gnuplot?

There has recently been a series of changes to the title and label placement
code in the development version.  I am not seeing a problem like this at the
moment, but possibly part way through the series of patches there was
period when the page layout was incorrect.  

If you are running the development version, what does it report on entry as the
"last modified" date?

        Ethan

>
> Here is the setup:
> set term gif font \"ariel,14\" size 1024, 600
> set output "/usr/local/www/data/a_rain.gif"
> set colors classic
> set grid xtics ytics
> set boxwidth 0.8 relative
> set xlabel "Rainfall year is July 1 - June 30"
> set ylabel "Inches"
> set xrange [ 1996:2016 ]
> set x2tics ($x2tics) font "ariel, 8"
> set xtics ($xtics) font "ariel,8"
> set title "Annual Rainfall" font "ariel,24"
> plot "-" using 1:2 notitle with boxes fs solid lc rgb "black"
>
> You can see the result at http://ykoberman.dlinkddns.com/a_rain.gif
>
> I get similar results with other plots that include x2tic labels.
>
> Any idea what is going on here?
>
> Kevin Oberman, Part time kid herder and retired Network Engineer
> E-mail: [hidden email]
> PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> gnuplot-info mailing list
> [hidden email]
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info

--


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Titles cropped when x2tics labels are added

Ethan A Merritt-2
In reply to this post by Kevin Oberman
On Saturday, 12 November 2016 11:32:26 PM Kevin Oberman wrote:

> When I add labels above the plot (x2tics), my titles is cropped. There is a
> great deal of space below the title.
>
> Here is the setup:
> set term gif font \"ariel,14\" size 1024, 600
> set output "/usr/local/www/data/a_rain.gif"
> set colors classic
> set grid xtics ytics
> set boxwidth 0.8 relative
> set xlabel "Rainfall year is July 1 - June 30"
> set ylabel "Inches"
> set xrange [ 1996:2016 ]
> set x2tics ($x2tics) font "ariel, 8"
> set xtics ($xtics) font "ariel,8"
> set title "Annual Rainfall" font "ariel,24"
> plot "-" using 1:2 notitle with boxes fs solid lc rgb "black"
>
> You can see the result at http://ykoberman.dlinkddns.com/a_rain.gif
>
> I get similar results with other plots that include x2tic labels.
>
> Any idea what is going on here?

> Version is 5.05. I fixed the font (actually changed to Cantarell) and it
> and the font changed, but the title is still cropped about in the middle.


I think that the problem is when the program allocates space for the
various titles, borders, tics, labels, etc, it does not take into account
that the title is going to be in a bigger font than the rest.  So it
leaves room for a 14pt title.  Then when it actual prints a 24pt title
there isn't enough room for the taller characters.

But even without the font change I agree that it leaves less room than
it ought to.   I've gone back and compared old gnuplot versions.
It looks to me that the problem crept in between versions 4.4 and version
4.6.  Version 4.4 placed the title with respect to the _top_ of the characters.
If you increased the font size the title extended further down, not up.
Version 4.6 changed this to some other logic, kept in version 5.0, and
the newer code doesn't deal well with the increase in font size.

Anyhow....
The placement of titles, axis labels, tics, etc has been reworked recently
in the development version.   Although this particular issue was not fixed
deliberately, the reworked code seems to handle it correctly.
So 5.1 is fine, but that doesn't help you with 5.0

Work-arounds:

- increase the top margin, e.g. set tmargin 6
  (you may have to experiment with the exact value)

- Place a newline in the title:
  set title "\nAnnual Rainfall" font ",24"

- Decrease the vertical size of the plot
  set size 1.0, 0.9

        hope that helps,

                Ethan




------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Titles cropped when x2tics labels are added

Kevin Oberman
On Sun, Nov 13, 2016 at 5:20 PM, Ethan A Merritt <[hidden email]>
wrote:

> On Saturday, 12 November 2016 11:32:26 PM Kevin Oberman wrote:
> > When I add labels above the plot (x2tics), my titles is cropped. There
> is a
> > great deal of space below the title.
> >
> > Here is the setup:
> > set term gif font \"ariel,14\" size 1024, 600
> > set output "/usr/local/www/data/a_rain.gif"
> > set colors classic
> > set grid xtics ytics
> > set boxwidth 0.8 relative
> > set xlabel "Rainfall year is July 1 - June 30"
> > set ylabel "Inches"
> > set xrange [ 1996:2016 ]
> > set x2tics ($x2tics) font "ariel, 8"
> > set xtics ($xtics) font "ariel,8"
> > set title "Annual Rainfall" font "ariel,24"
> > plot "-" using 1:2 notitle with boxes fs solid lc rgb "black"
> >
> > You can see the result at http://ykoberman.dlinkddns.com/a_rain.gif
> >
> > I get similar results with other plots that include x2tic labels.
> >
> > Any idea what is going on here?
>
> > Version is 5.05. I fixed the font (actually changed to Cantarell) and it
> > and the font changed, but the title is still cropped about in the middle.
>
>
> I think that the problem is when the program allocates space for the
> various titles, borders, tics, labels, etc, it does not take into account
> that the title is going to be in a bigger font than the rest.  So it
> leaves room for a 14pt title.  Then when it actual prints a 24pt title
> there isn't enough room for the taller characters.
>
> But even without the font change I agree that it leaves less room than
> it ought to.   I've gone back and compared old gnuplot versions.
> It looks to me that the problem crept in between versions 4.4 and version
> 4.6.  Version 4.4 placed the title with respect to the _top_ of the
> characters.
> If you increased the font size the title extended further down, not up.
> Version 4.6 changed this to some other logic, kept in version 5.0, and
> the newer code doesn't deal well with the increase in font size.
>
> Anyhow....
> The placement of titles, axis labels, tics, etc has been reworked recently
> in the development version.   Although this particular issue was not fixed
> deliberately, the reworked code seems to handle it correctly.
> So 5.1 is fine, but that doesn't help you with 5.0
>
> Work-arounds:
>
> - increase the top margin, e.g. set tmargin 6
>   (you may have to experiment with the exact value)
>
> - Place a newline in the title:
>   set title "\nAnnual Rainfall" font ",24"
>
> - Decrease the vertical size of the plot
>   set size 1.0, 0.9
>
>         hope that helps,
>
>                 Ethan


tmargin did the trick, but the problem does not appear to match with your
analysis. I suspect an issue with x2tics.

First, putting a newline before the title did exactly nothing. Oh, well.
tmargin 5 had the expected effect, but left the very large gap between the
title and the x2tics labels. If I remove the labels, the gap between the
title and the graph shrinks significantly to what it should be and the
title is properly placed wit no adjustment needed.

If I add x2tics labels, the gap between the labels and the title increases
significantly and title moves up to the point that it no longer fits. the
size of the font does have an impact, but, in all cases the title moves up
to near (small font) the top of the image or past it (larger font). With
Cantarell Regular it hits the top at 16 points but is right at the top for
any size font.

To me (and Ihave not looked at the code) it looks like the problem is with
the space allowed for the x2tics labels. It appears that the space
allocated is at least twice the appropriate size that is used to calculate
the position of the title.

Thansk again for looking at this and I hope you can either track it down or
that someone else has and it will make it into either 5.0.6 or 5.1,
whichever comes first. I the meantime, tmargin is an acceptable work-around.

Thanks so much for looking at this and suggesting solutions!
--
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: [hidden email]
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Loading...