Skip to content

Instantly share code, notes, and snippets.

@Gro-Tsen
Created August 14, 2022 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gro-Tsen/0c37671e1e22b6ffa257ccb917edef1c to your computer and use it in GitHub Desktop.
Save Gro-Tsen/0c37671e1e22b6ffa257ccb917edef1c to your computer and use it in GitHub Desktop.
set terminal pngcairo size 800,600
set output "/tmp/temps.png"
w0(x)=a0+b0*x+c0*x*x
fit w0(x) "time_era5_t2m_France_metropolitan_mon12_ave3_dump0.txt" using ($3+$4/12-2000):($2) via a0,b0,c0
title0=sprintf("hiver (régr. %.2f°+%.2f×(Y−2000)/100+%.2f×((Y−2000)/100)²)", a0, b0*100, c0*1e4)
w1(x)=a1+b1*x+c1*x*x
fit w1(x) "time_era5_t2m_France_metropolitan_mon3_ave3_dump0.txt" using ($3+$4/12-2000):($2) via a1,b1,c1
title1=sprintf("printemps (régr. %.2f°+%.2f×(Y−2000)/100+%.2f×((Y−2000)/100)²)", a1, b1*100, c1*1e4)
w2(x)=a2+b2*x+c2*x*x
fit w2(x) "time_era5_t2m_France_metropolitan_mon6_ave3_dump0.txt" using ($3+$4/12-2000):($2) via a2,b2,c2
title2=sprintf("été (régr. %.2f°+%.2f×(Y−2000)/100+%.2f×((Y−2000)/100)²)", a2, b2*100, c2*1e4)
w3(x)=a3+b3*x+c3*x*x
fit w3(x) "time_era5_t2m_France_metropolitan_mon9_ave3_dump0.txt" using ($3+$4/12-2000):($2) via a3,b3,c3
title3=sprintf("automne (régr. %.2f°+%.2f×(Y−2000)/100+%.2f×((Y−2000)/100)²)", a3, b3*100, c3*1e4)
plot [1950:2022] w0(x-2000) lt rgb "#8080ff" dashtype 2 notitle, [1950:2022] w1(x-2000) lt rgb "#80ff80" dashtype 2 notitle, [1950:2022] w2(x-2000) lt rgb "#ff8080" dashtype 2 notitle, [1950:2022] w3(x-2000) lt rgb "#ffc080" dashtype 2 notitle, "time_era5_t2m_France_metropolitan_mon12_ave3_dump0.txt" using ($3+$4/12):($2) with lines lt rgb "#8080ff" title title0, "time_era5_t2m_France_metropolitan_mon3_ave3_dump0.txt" using ($3+$4/12):($2) with lines lt rgb "#80ff80" title title1, "time_era5_t2m_France_metropolitan_mon6_ave3_dump0.txt" using ($3+$4/12):($2) with lines lt rgb "#ff8080" title title2, "time_era5_t2m_France_metropolitan_mon9_ave3_dump0.txt" using ($3+$4/12):($2) with lines lt rgb "#ffc080" title title3
@Gro-Tsen
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment