Reputation: 859
I have a fortran code as below
program compute_plot
integer :: i, n = 10
real :: x(10), y(10)
x(1) = 0.0
y(1) = 0.0
do i = 2, n
x(i) = 0.1*i
y(i) = x(i)*x(i)
end do
open(unit = 5, file = 'data.txt')
do i = 1, n
write(5,*) x(i),y(i)
end do
close(5)
call system('gnuplot -p data_plot.gnu')
end program compute_plot
and another gnuplot script as below
reset
set terminal pngcairo dashed enhanced size 480,360 font 'arial,12' fontscale 1.0
set encoding utf8
set output 'plot.png'
set xlabel "x"
set ylabel "y"
m = "./data.txt"
set title 'The parabola'
plot m using 1:2 w l
These two code work well in Linux terminal, but I could not find a way to make them work in Windows command prompt. I also not sure if it is possible to make them work in Windows. Please advise.
Upvotes: 1
Views: 4996
Reputation: 859
F:Document
;F:\Documents\gnuplot\
;This PC
, click on Properties
, click on Advanced system settings
, click on Advanced
tab, click on Environment Variables...
;Path
on the top table of Environment Variables
windows, then click Edit...
;New
to add in the path of gnuplot.exe
, e.g. in my desktop F:\Documents\gnuplot\bin
Command prompt
and run the command of gnuplot
.Upvotes: 1