3
votes

I would like to plot the output of a dataset so that there is one pixel per sample, on the X axis. e.g. if I have a dataset of 500 samples then I would like to ensure that the X axis is 500 pixels wide. Does anyone know how to do this with Gnuplot ?

Thanks very much, John

1
You can set the size of the canvas with set term your_terminal size 500,y_size, where you fill in the values of your_terminal and y_size. y_size might be optional, I can't test it at the moment. Also, the units of the size may depend on the terminal you choose. See the docs: gnuplot.sourceforge.net/docs_4.6/gnuplot.pdf - darthbith

1 Answers

2
votes

This request makes sense only for bitmap terminals. In order to get a plotting area with a fixed size, you must both set a respective terminal size and fixed margins. The following script gives a plotting area of 500px width. This includes the 1px thick border lines, which are also part of the plotting area, what you can see, with set border back:

set terminal pngcairo size 600,500
set lmargin at screen 80.0/600
set rmargin at screen 579.0/600

set border back
set output 'output.png'
plot x