Script para gnuplot: mudanças entre as edições

De Física Computacional
Ir para navegação Ir para pesquisar
Sem resumo de edição
Sem resumo de edição
 
(Uma revisão intermediária por um outro usuário não está sendo mostrada)
Linha 1: Linha 1:
Script do Gnuplot para gerar as imagens.
Script do Gnuplot para gerar as imagens. Salvar arquivo como "graph.plt".


<source lang='gnuplot'>
<source lang='gnuplot'>
Linha 30: Linha 30:


# Loop
# Loop
do for [i=0:tmax] {   
do for [i=0:tmax:2] {   
     # Print: current_frame total_frame
     # Print: current_frame total_frame
     print i,tmax
     print i,tmax
     # Output file format
     # Output file format
     outfile = sprintf("../img/".dir."/fput%d.png", i)
     outfile = sprintf("../img/".dir."/fput%d.png", int(i/2))
     set output outfile
     set output outfile
     # Time
     # Time

Edição atual tal como às 12h16min de 1 de maio de 2022

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
    }