premier dessin avec plplot
This commit is contained in:
6
code/fortran/.gitignore
vendored
Normal file
6
code/fortran/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
plplotting
|
||||
dessiner
|
||||
|
||||
*.png
|
||||
|
||||
@@ -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
41
code/fortran/dessiner.f90
Normal 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
|
||||
Reference in New Issue
Block a user