顯示具有 gnuplot 標籤的文章。 顯示所有文章
顯示具有 gnuplot 標籤的文章。 顯示所有文章

2017年12月30日 星期六

Gnuplot-3D


splot "data.txt" using 1:2:3 with lines






#data.txt 每一條線隔2行空白, 線可分開繪製, 若是只隔一行空白則會連起來




#data.txt
# X   Y    Z
16    16   0
16   32   1
16   64   15
16    128  4
16    256  9


32    16   10
32   32   21
32    64   31
32    128  34
32    256  49


64    16   0
64   32   12
64   64   19
64    128  41
64    256  93


128   16   30
128   32   31
128   64   15
128   128  14
128   256  93


256   16   30
256   32   31
256   64   80
256   128  14
256   256  5

https://goo.gl/EcCcj7

https://goo.gl/uMDpM1

2016年11月13日 星期日

gnuplot



唸書時期畫的, 工程圖表就是用gnuplot

Gnuplot is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986.

    # Gnuplot script file for plotting data in file "force.dat"
      # This file is called   force.p
      set   autoscale                        # scale axes automatically
      unset log                              # remove any log-scaling
      unset label                            # remove any previous labels
      set xtic auto                          # set xtics automatically
      set ytic auto                          # set ytics automatically
      set title "Force Deflection Data for a Beam and a Column"
      set xlabel "Deflection (meters)"
      set ylabel "Force (kN)"
      set key 0.01,100
      set label "Yield Point" at 0.003,260
      set arrow from 0.0028,250 to 0.003,280
      set xr [0.0:0.022]
      set yr [0:325]
      plot    "force.dat" using 1:2 title 'Column' with linespoints , \
            "force.dat" using 1:3 title 'Beam' with points


===================

Gnuplot - for loop iteration 產生多個不同檔案
windows gnuplot產生 png


#set terminal postscript eps
#set output 'myfigure.eps'
#set term png
set autoscale
set title 'P-persistent Simulation (Channel=3)'  font ",28"       # plot title
set xlabel 'Probability' font ",16"                                  # x-axis label
set ylabel 'Throughput' font ",16"                         # y-axis label
#set yrange [0:1]
#set xrange [1:8]

set label 'ittraining' at 12,8
#N_CHANNEL,N_user,prob,total_T/MAX_N_Round);

do for [t=0:5] {
    set terminal pngcairo
    outfile = sprintf('test%03.0f.png',t)
    set output outfile
plot \
'C3U1.txt' using 3:4 w lp t "U=1",\
'C3U3.txt' using 3:4 w lp t "U=3",\
'C3U5.txt' using 3:4 w lp t "U=5",\
'C3U7.txt' using 3:4 w lp t "U=7",\
'C3U9.txt' using 3:4 w lp t "U=9",\
'C3U11.txt' using 3:4 w lp t "U=11",\
'C3U13.txt' using 3:4 w lp t "U=13",\
'C3U15.txt' using 3:4 w lp t "U=15",\
'C3U17.txt' using 3:4 w lp t "U=17",\
'C3U19.txt' using 3:4 w lp t "U=19"


}


References:

  1. https://sourceforge.net/projects/gnuplot/?source=typ_redirect
  2. DEMO Gnuplot http://gnuplot.sourceforge.net/demo/
  3. http://www.maths.manchester.ac.uk/~pjohnson/Gnuplot/windows_gnuplot.html