# Gnuplot script file for plotting data in file "*.dat" # This file is called estilo.p #======================================================= # Line wide point size and font aspects #======================================================= # # Specify the line wide and dot size linw=0.6 poin=0.9 fsize=14 #====================================================== # Output settings terminals #===================================================== # # Type of file you want to print the plot # eps is the most recomended # Default: Shows it on your screen #set term post eps size 7.00 cm ,4.00 cm enhanced "Times-Roman, 14" #set output "outputfile.eps" #====================================================== # Standard initialization to create the plot # some tags are for latin-american speakers #====================================================== set termopt enhanced # Allows to put ^super/_{sub} indexes set autoscale # scale axes automatically set termoption dashed # Allows dash styles set terminal pngcairo dashed # Dash style for png terminal unset log # remove any log-scaling unset label # remove any previous labels set xtic auto # set xtics automatically set ytic auto # set ytics automatically set encoding iso_8859_1 # Allow to put accents set grid # Set the type of grid #====================================================== # SPECIFY PLOT RANGE #====================================================== # set xr [-60 :180] set yr [0:150] #======================================================== # KEYWORDS to control the PLOT LABELS #======================================================== # There are two ways to use the predertermine positions # or to indicate the x,y position using # set key nobox at x, y set key outside nobox #default inside the plot #Para poner las leyendas en dif posiciones gnuplot utiliza # top/bottom/center left/right/center box/nobox # set key center right box #======================================================== # PLOT INSIDE THE TOTAL CANVAS #======================================================== # Controls the position of the plot on the canvas # you can add extra "air" on the sides # l-> left t-> top r-> range # set lmargin # set tmargin set rmargin 18 # set bmargin 5 #======================================================= # TITLES AND XY TIC LABELS #======================================================= # You can modify the font and size but # is not necesary because you specify that on # the outprint format set title "Line and point styles" set xlabel "" set ylabel "" #======================================================= # Line Styles #======================================================= set style line 1 lt 1 lw linw+0.5 pt 1 ps poin lc rgb "navy" set style line 2 lt 2 lw linw+0.5 pt 2 ps poin+0.2 lc rgb "red" set style line 3 lt 3 lw linw+0.5 pt 3 ps poin+0.2 lc rgb "blue" set style line 4 lt 4 lw linw+0.5 pt 4 ps poin+0.2 lc rgb "olive" set style line 5 lt 5 lw linw+0.5 pt 5 ps poin-0.2 lc rgb "black" set style line 6 lt 6 lw linw+0.5 pt 6 ps poin+0.2 lc rgb "gray20" #====================================================== # Add information and arrows to the plot #====================================================== #set label "Arrow" at 20,10.05 font "Arial, 13" #Arrow can be "nohead" # set arrow from 19,10 to 24,10 #====================================================== # Fit data to equations #====================================================== # # f1(x)= m*x + b # b=0 # m=0 # fit f1(x) 'linear_data.dat' using 1:2 via m, b # stats 'linear_data.dat' using 1:2 name 'fit' # set label 1 sprintf("r = %1.6f",fit_correlation) at 21, 1.7 #====================================================== # Output settings terminals #===================================================== # # Type of file you want to print the plot # eps is the most recomended # Default: Shows it on your screen set term pngcairo size 640,480 enhanced font "Times-Roman, 14" set output "line_points.png" #======================================================= # Plot instructions #======================================================= # filedatax.dat is your data file # using tag means which versus which column you are plotting # title mean the label title on the key box plot x**2 title 'point style 1' with points ls 1 , \ x**2+10 title 'point style 2' with points ls 2 , \ x**2+20 title 'point style 3' with points ls 3 , \ x**2+30 title 'point style 4' with points ls 4 , \ x**2+40 title 'point style 5' with points ls 5 , \ x**2+55 title 'point style 6' with points ls 6, \ x**2+65 title 'line style 1' with lines ls 1 , \ x**2+75 title 'line style 2' with lines ls 2 , \ x**2+85 title 'line style 3' with lines ls 3 , \ x**2+95 title 'line style 4' with lines ls 4 , \ x**2+105 title 'line style 5' with lines ls 5 , \ x**2+115 title 'line style 6' with lines ls 6; unset style line reset