Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot - no space between graph and png image edge

Tags:

gnuplot

How to create a .png image in gnuplot to see no spaces between graph itself and image edges. I use

set terminal pngcairo size 800,600 enhanced 

I want exactly 800x600 image. And want all 0X axis correspond to [0..800] interval, and all 0Y correspond to [0..600] interval.

like image 203
egor7 Avatar asked Jun 18 '12 23:06

egor7


1 Answers

It looks like you want to set the margins to 0. Here is an example script:

set terminal pngcairo size 800,600 enhanced
set output 'output.png'

set lmargin 0
set rmargin 0
set tmargin 0
set bmargin 0

#unset tics

plot sin(x) # notitle

This way the plot will fill the canvas exactly. You can type help set margin in gnuplot for details. (Uncomment the comments in my example if you want a slightly cleaner plot.)

like image 81
andyras Avatar answered Sep 23 '22 02:09

andyras