Showing posts with label gnuplot. Show all posts
Showing posts with label gnuplot. Show all posts

Monday, February 6, 2017

Polynomial expansion (多項式の展開): \((x+1)(x+2)(x+3)(x+4)\)

Q:

\((x+1)(x+2)(x+3)(x+4)\)


A:

\(x^4+10x^3+35x^2+50x+24\)


Command:

$ gnuplot


Result:

G N U P L O T
Version 5.0 patchlevel 5    last modified 2016-10-02

Copyright (C) 1986-1993, 1998, 2004, 2007-2016
Thomas Williams, Colin Kelley and many others

gnuplot home:     http://www.gnuplot.info
faq, bugs, etc:   type "help FAQ"
immediate help:   type "help"  (plot window: hit 'h')

Terminal type set to 'x11'


Command:

gnuplot> set zeroaxis lw 1 lt -1
gnuplot> set xr[-5:5]
gnuplot> set yr[-2.4:3.2]
gnuplot> set xtics 1
gnuplot> set ytics 1
gnuplot> set terminal png
Terminal type set to 'png'


Result:

Options are 'nocrop enhanced size 640,480 font "arial,12" '


Command:

gnuplot> set output 'polynomial.png'
gnuplot> plot x**4+10*x**3+35*x**2+50*x+24 lw 3


Output file:

polynomial.png

Wednesday, October 26, 2016

macOS Sierra: gnuplot: Installing and Plotting

Command:

$ gnuplot


Result:

G N U P L O T
Version 5.0 patchlevel 5    last modified 2016-10-02

Copyright (C) 1986-1993, 1998, 2004, 2007-2016
Thomas Williams, Colin Kelley and many others

gnuplot home:     http://www.gnuplot.info
faq, bugs, etc:   type "help FAQ"
immediate help:   type "help"  (plot window: hit 'h')

Terminal type set to 'unknown'


Command:

gnuplot> set terminal x11
Terminal type set to 'unknown'
                      ^
         unknown or ambiguous terminal type; type just 'set terminal' for a list


Command:

gnuplot> exit
$ brew uninstall gnuplot


Result:

Uninstalling /usr/local/Cellar/gnuplot/5.0.5... (45 files, 2.3M)


Command:

$ brew install gnuplot --with-aquaterm --with-x11


Result:

==> Using the sandbox
==> Downloading https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.0.5/gnuplot-5.0.5.tar.gz
==> Downloading from http://jaist.dl.sourceforge.net/project/gnuplot/gnuplot/5.0.5/gnuplot-5.0.5.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/gnuplot/5.0.5 --with-readline=/usr/local/opt/readline --disable-wxwidgets --without-cairo --wit
==> make
==> make install
==> Caveats
AquaTerm support will only be built into Gnuplot if the standard AquaTerm
package from SourceForge has already been installed onto your system.
If you subsequently remove AquaTerm, you will need to uninstall and then
reinstall Gnuplot.
==> Summary
🍺  /usr/local/Cellar/gnuplot/5.0.5: 47 files, 2.5M, built in 59 seconds


Command:

$ gnuplot


Result:

G N U P L O T
Version 5.0 patchlevel 5    last modified 2016-10-02

Copyright (C) 1986-1993, 1998, 2004, 2007-2016
Thomas Williams, Colin Kelley and many others

gnuplot home:     http://www.gnuplot.info
faq, bugs, etc:   type "help FAQ"
immediate help:   type "help"  (plot window: hit 'h')

Terminal type set to 'x11'


Command:

gnuplot> plot sin(x)


Result:


Gnuplot Sine(x)