Script para gnuplot

De Física Computacional
Ir para navegação Ir para pesquisar

Script do Gnuplot para gerar as imagens. Salvar arquivo como "graph.plt".

# Reset previous sessions
reset

# Data input
file = "../data/output.dat"

# Statistics about the data
stats file name "A"

# Set range of plots
set xrange [A_min_x:A_max_x]    # x-axis
set yrange [-1.2:1.2]           # y-axis

# Customize the output 
set term pngcairo size 800, 600 enhanced font "Arial,10" fontscale 1.0

# Title and labels
set title "FPUT - Descolamento vertical" font "Oswald,18"
set xlabel "Posição (x)" font ",12"
set ylabel "Altura (y)" font ",12"

# Total number of frames
tmax = int(A_blocks-1)

# Text position in y
text_y = (A_max_x-A_min_x)*0.05

# Loop
do for [i=0:tmax:2] {  
    # Print: current_frame total_frame
    print i,tmax
    # Output file format
    outfile = sprintf("../img/".dir."/fput%d.png", int(i/2))
    set output outfile
    # Time
    unset label
    set label "Iteração: ".i at text_y, 1 font ",10"
    # Plot
    plot file index i with points pt 7 ps 2 lc rgb 'black' notitle
    }