官术网_书友最值得收藏!

Adding a new package

Before adding a new package, it is always a good idea to update your package database for the already installed packages with the up command. Then, add a new package by issuing the add PackageName command, and execute it by using PackageName in the code or in the REPL.

For example, to add 2D plotting capabilities, install the Plots package with add Plots in the Package mode by first typing ]. This installs the Plots package and all of its dependencies, building them when needed.

To make a graph of 100 random numbers between 0 and 1, execute the following commands:

using Plots 
plot(rand(100))

The rand(100) function is an array with 100 random numbers. This produces the following output:

A plot of white noise with Plots

After installing a new Julia version, update all the installed packages by running up in the Pkg REPL-mode.

主站蜘蛛池模板: 益阳市| 乌恰县| 永寿县| 田林县| 临沧市| 县级市| 瑞丽市| 乃东县| 白玉县| 奉新县| 明水县| 珲春市| 铁岭市| 固安县| 屏山县| 定边县| 中超| 工布江达县| 梁河县| 福建省| 康马县| 望江县| 塔河县| 电白县| 正安县| 宣化县| 德阳市| 敖汉旗| 聊城市| 合水县| 堆龙德庆县| 许昌市| 乌拉特前旗| 中方县| 康马县| 前郭尔| 孙吴县| 石屏县| 大方县| 齐齐哈尔市| 汾阳市|