premier dessin avec plplot

This commit is contained in:
tTh
2023-03-07 20:49:36 +01:00
parent 04eeae6de9
commit aa4f0664cb
5 changed files with 102 additions and 9 deletions

6
code/fortran/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
plplotting
dessiner
*.png

View File

@@ -3,3 +3,6 @@ INCS = -I/usr/include/plplot -I/usr/lib/x86_64-linux-gnu/fortran/modules/plplot
plplotting: plplotting.f90 Makefile
gfortran -g $< $(INCS) -lplplotfortran -o $@
dessiner: dessiner.f90 Makefile
gfortran -g $< $(INCS) -lplplotfortran -o $@

41
code/fortran/dessiner.f90 Normal file
View File

@@ -0,0 +1,41 @@
program dessiner
use plplot
implicit none
character(len=80) :: version
call plgver(version)
write (*,'(a,a)') 'plplot version: ', trim(version)
call plsdev('xwin')
call plinit ()
call plenv(-2.2, 2.2, -2.2, 2.2, 0, 1)
call dessin_1 ()
call plend
contains ! -----------------------------
subroutine dessin_1 ()
integer, parameter :: lg = 500
real :: x(lg), y(lg)
real :: k
integer :: i
k = 0.1
do i = 1, lg
x(i) = k * sin(real(i)/3.0)
y(i) = k * cos(real(i)/3.0)
k = k * 1.0060
enddo
print *, i, k, x(i), y(i)
call plcol0 (15) ! pure white
call pllab ("Fuzzfactor", "Yoyodines", "Some nice plots from tTh")
call plcol0 (12)
call plline (x, y)
end subroutine
end program