|
From: Ethan A M. <eam...@gm...> - 2016-11-14 01:20:15
|
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 |