Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3146 > unrolled thread

How to adjust the automatic yaxis scale to provide headroom in bar chart

Started bythats.unpossible@gmail.com
First post2015-12-11 19:55 -0800
Last post2015-12-15 10:57 +0100
Articles 4 — 4 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  How to adjust the automatic yaxis scale to provide headroom in bar chart thats.unpossible@gmail.com - 2015-12-11 19:55 -0800
    Re: How to adjust the automatic yaxis scale to provide headroom in bar chart Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2015-12-12 16:27 +0100
      Re: How to adjust the automatic yaxis scale to provide headroom in bar chart Rolf Campbell <thats.unpossible@gmail.com> - 2015-12-12 09:49 -0800
        Re: How to adjust the automatic yaxis scale to provide headroom in bar chart Jörg Buchholz <bookwood4new@freenet.de> - 2015-12-15 10:57 +0100

#3146 — How to adjust the automatic yaxis scale to provide headroom in bar chart

Fromthats.unpossible@gmail.com
Date2015-12-11 19:55 -0800
SubjectHow to adjust the automatic yaxis scale to provide headroom in bar chart
Message-ID<f45b5fc4-e7ae-4cfe-987b-b5e09c1ac702@googlegroups.com>
I'm using "gnuplot 5.0 patchlevel 1" and I noticed that when I plot a bar graph, sometimes the autoscale for the y-axis causes one of the bars to be jammed up against the top edge of the chart (with no headroom at all).  This is not very visually appealing.  Is there any way to tell the autoscale setting to leave a bit of headroom above the top data box?

Here's an example that exhibits the problem:

set terminal svg size 1024,768
set output "ottawa/svg/MAX_TEMP.top10.svg"
set xtics rotate 90 ("2015" 0, "1911" 1, "1879" 2, "1939" 3, "1953" 4, "1923" 5, "1948" 6, "1884" 7, "1932" 8, "1998" 9, "1951" 10) font "Arial,20"
set y2label "maximum temperature (^oC)"
unset ytics
set y2tics
set key on left
set title "Top 10 Ottawa daily maximum temperatures for Dec 07"
set lmargin 6.0
set rmargin 8.0
set tmargin 2.0
set bmargin 5.0
set xrange [-1:11]
set boxwidth 0.750000
set style fill solid 1.00 border -1
set grid noxtics front
plot '-' title 'Other years' axes x1y2 with boxes fc rgb "0x6495ED" fs solid 1.0 noborder, '-' title 'This year' axes x1y2 with boxes fc rgb "0x556B2F" fs solid 1.0 noborder
1 5.600000 # 1911
2 5.600000 # 1879
3 6.100000 # 1939
4 6.700000 # 1953
5 6.700000 # 1923
6 7.800000 # 1948
7 8.300000 # 1884
8 8.300000 # 1932
9 14.100000 # 1998
10 15.000000 # 1951
e
0 5.600000 # 2015
e

[toc] | [next] | [standalone]


#3147

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2015-12-12 16:27 +0100
Message-ID<dd2snaForltU2@mid.dfncis.de>
In reply to#3146
Am 12.12.2015 um 04:55 schrieb thats.unpossible@gmail.com:

> I'm using "gnuplot 5.0 patchlevel 1" and I noticed that when I plot a
> bar graph, sometimes the autoscale for the y-axis causes one of the
> bars to be jammed up against the top edge of the chart (with no
> headroom at all).  This is not very visually appealing.  Is there any
> way to tell the autoscale setting to leave a bit of headroom above
> the top data box?

See "help set offset"

[toc] | [prev] | [next] | [standalone]


#3148

FromRolf Campbell <thats.unpossible@gmail.com>
Date2015-12-12 09:49 -0800
Message-ID<7b1d6912-f638-4dd3-a0bd-7ca1156e905e@googlegroups.com>
In reply to#3147
On Saturday, December 12, 2015 at 10:27:40 AM UTC-5, Hans-Bernhard Bröker wrote:
> Am 12.12.2015 um 04:55 schrieb thats.unpossible@gmail.com:
> See "help set offset"

I tried that, but "set offset" seems to do nothing with an x1y2 plot.  I think it only works with x1y1.

[toc] | [prev] | [next] | [standalone]


#3151

FromJörg Buchholz <bookwood4new@freenet.de>
Date2015-12-15 10:57 +0100
Message-ID<n4oo6m$ls4$1@newsserver.rrzn.uni-hannover.de>
In reply to#3148
On 12.12.2015 18:49, Rolf Campbell wrote:
> On Saturday, December 12, 2015 at 10:27:40 AM UTC-5, Hans-Bernhard Bröker wrote:
>> Am 12.12.2015 um 04:55 schrieb thats.unpossible@gmail.com:
>> See "help set offset"
>
> I tried that, but "set offset" seems to do nothing with an x1y2 plot.  I think it only works with x1y1.
>
As a workaround you can plot first with the term unknown and than set 
the y2range.

......
set term unknown
plot '-' title 'Other years' axes x1y2 with boxes fc rgb "0x6495ED" fs 
solid 1.0 noborder, '-' title 'This year' axes x1y2 with boxes fc rgb 
"0x556B2F" fs solid 1.0 noborder
1 5.600000 # 1911
2 5.600000 # 1879
3 6.100000 # 1939
4 6.700000 # 1953
5 6.700000 # 1923
6 7.800000 # 1948
7 8.300000 # 1884
8 8.300000 # 1932
9 14.100000 # 1998
10 15.000000 # 1951
e
0 5.600000 # 2015
e
y2o = GPVAL_Y2_MAX + 2.0
set y2range [*:y2o]
set terminal svg size 1024,768
set output "test.svg"
replot
set out

Jörg

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web