1
votes
set style data histogram
set style histogram rowstacked
set style fill solid border

set terminal png

set output 'permfail.png'

set boxwidth 0.5 relative # histogram bar width

set title "Analysis of dangerus permissions"
set ylabel "Apps percentage %"
set yrange [0 : 100]

set xtics noenhanced # no escaping for strings
set xtics rotate by 40 right

set grid ytics

plot for [COL=2:2] 'permfail.dat' using COL:xticlabels(1) title columnheader fs pattern 2 lc rgb "black"

Permission distribution

As you can see, the xtics are cutted from the image and they are too close. How can I improve it?

1

1 Answers

1
votes

To increase the spacing between the xtic labels you must increase your terminal size, like

set terminal pngcairo size 1000,500

Gnuplot cannot get the exact length of a string, because it doesn't know about the internals of the terminal's font rendering. So it can only estimate an approximate string length. Especially for long labels, like you have, this can go wrong. In that case you must explicitely set an appropriate bottom margin (adapt the number to fit your needs)

set bmargin 20

or

set bmargin at screen 0.3