Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output plot with tics labels inside and without any margins/padding with gnuplot?

Tags:

gnuplot

Using the following one-liner:

gnuplot -e 'set terminal png font ",7" size 300,200 ; \
set output "out.png"; \
set tics in; \
set obj 1 rect behind from screen 0,0 to screen 1,1 ; \
set obj 1 fs fc rgb "gray" ; \
plot sin(x)'

I get this output:

gpout.png

What I want is:

  • Both tics and labels inside the plot
  • No margins/padding - so that the plot takes the full requested size

... that is, something like this:

gpout_wanted.png

(this image was scaled composited in gimp, so ignore the changes in color and apparent resolution)

Any ways to achieve something like this in gnuplot?

like image 451
sdaau Avatar asked Aug 04 '26 15:08

sdaau


1 Answers

you might want to try to tweak this

set lmargin at screen 0
set rmargin at screen 1
set tmargin at screen 1
set bmargin at screen 0
set xtics offset 0, screen 0.1
set ytics offset screen 0.1, 0
plot sin(x)
like image 141
bibi Avatar answered Aug 07 '26 00:08

bibi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!