[Added on October 24, 2017]
The information below is very old and now
Install Julia → Pkg.add ("PyPlot ")
→ ʻusing PyPlot`
OK. All necessary matplotlib etc. are automatically installed via anaconda.
If you want to use matplotlib etc. that already exists when you newly install Julia or PyPlot with matplotlib etc. already installed, it seems that some settings are required, so please check by yourself.
[Updated on October 24, 2017]
There is already an article existing that installs Julia and PyPlot on Windows and draws a graph, but since the information is old, it also serves as a memo for myself. To write a new one. The author's environment is Windows10 64bit.
Download and install what you need from the Official Site. I installed the 64-bit version of Python 2.7, but I haven't confirmed if it's okay with the Python 3 series. By default, the installer does not pass Path, so pass Path.
All you need is pip in the required packages. pip should be included when you install Python by default, so you don't need to install anything new.
First of all,
pip install -U pip
Update pip itself with.
next,
pip install -U matplotlib
Install matplotlib with. At this time, ** all dependent packages are also installed **, so there is no need to install additional numpy etc. If you are worried
pip install -U package name
You can find what you need in (matplotlib Installation Guide,
setuptools, numpy, python-dateutil, pytz, pyparsing, and cycler
Etc.) should check if it is the latest version.
This is also downloaded from the Official Site and installed. However, ** Python and the number of bits (?) Must be matched **. For example, if the installed Python is a 64-bit version, Julia also installs the 64-bit version. I think it's better to install it directly under the C drive just in case (but I'm not sure if this makes sense).
Start Julia and on the command line
Pkg.add("PyPlot")
After a while, the installation should be completed. This is OK only once.
If something goes wrong and the installation is unsuccessful, after resolving the issue,
Pkg.build("PyPlot")
To execute.
When you actually want to use PyPlot, on Julia
using PyPlot
To execute. Once you run it, you don't have to run it again until you quit Julia. If you restart Julia, run it when you need it.
After executing ʻusing PyPlot`, the graph of $ y = \ sin x $ should be drawn.
x = linspace(0, 2*pi, 100);
y = sin(x);
plot(x, y)
Recommended Posts