mirror of
https://github.com/BreizhHardware/cours-ISEN-MD.git
synced 2026-01-18 16:47:24 +01:00
34 lines
1008 B
Plaintext
34 lines
1008 B
Plaintext
# Set separator of data lines and grid to plot
|
|
set datafile separator ";"
|
|
set grid
|
|
|
|
# Set names of stuff
|
|
set title "Execution Time vs Complexity"
|
|
set xlabel "number of elements"
|
|
set ylabel "time in milliseconds"
|
|
|
|
# Set line style, color, width, blabla
|
|
set style line 1 linecolor rgb '#ff0000' linetype 1 linewidth 2
|
|
set style line 2 linecolor rgb '#00ff00' linetype 1 linewidth 2
|
|
|
|
#### Prepare the function
|
|
f(x) = c * x ** 2
|
|
|
|
#### Fit the function to data
|
|
fit f(x) 'd:\Desktop\Cours\tuto_graficos\data.csv' via c
|
|
|
|
# Save value of c to show in the function
|
|
|
|
title_f(c) = sprintf("f(x) = c*n^2, c = %f", c)
|
|
|
|
# Automatic scaling of axes
|
|
set autoscale xy
|
|
|
|
#### Plot both data and function (data with continuous line)
|
|
# plot 'd:\Desktop\Cours\tuto_graficos\data.csv' title 'data' with lines linestyle 1, f(x) title title_f(c) with lines linestyle 2
|
|
|
|
#### Plot both data and function (data with points)
|
|
plot 'd:\Desktop\Cours\tuto_graficos\data.csv' title 'data', f(x) title title_f(c) with lines linestyle 2
|
|
|
|
|