{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Jupyter Scilab Kernel\n",
"============\n",
"\n",
"Interact with Scilab in the Notebook. All commands are interpreted by Scilab. Since this is a [MetaKernel](https://github.com/Calysto/metakernel), a standard set of magics are available. Help on commands is available using the `%help` magic or using `?` with a command."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"t = linspace(0,6*%pi,100);\n",
"plot(sin(t))\n",
"plot(cos(t), 'r')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"b = 10*cos(t)+30; plot(b);"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" a = \n",
" 1. 2. 3.\n"
]
}
],
"source": [
"a = [1,2,3]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"b = a + 3;"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" 4. 5. 6.\n"
]
}
],
"source": [
"disp(b)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Available line magics:\n",
"%activity %cd %connect_info %conversation %dot %download %edit %get %help %html %include %install %install_magic %javascript %jigsaw %kernel %kx %latex %load %ls %lsmagic %macro %magic %matplotlib %parallel %plot %pmap %px %python %reload_magics %restart %run %scheme %set\n",
"\n",
"Available cell magics:\n",
"%%activity %%brain %%conversation %%debug %%dot %%file %%help %%html %%javascript %%kx %%latex %%macro %%pipe %%processing %%px %%python %%scheme %%show %%time %%tutor\n"
]
}
],
"source": [
"%lsmagic"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can configure specific plot settings using the `%plot` magic. For example, to enable or disable the antialiasing."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Usage: %plot [options] backend - configure plotting for the session.\n",
"\n",
"This line magic will configure the plot settings for this\n",
"language.\n",
"\n",
"Examples:\n",
" %plot qt --format=png\n",
" %plot inline -w 640\n",
"\n",
"Note: not all languages may support the %plot magic, and not all\n",
"options may be supported.\n",
"\n",
"Options:\n",
"-------\n",
"-a --antialiasing To disable antialiasing set it to False\n",
"-h --height Plot height in pixels\n",
"-w --width Plot width in pixels\n",
"-r --resolution Resolution in pixels per inch\n",
"-b --backend Backend selection [default: inline]\n",
"-f --format Plot format (png, svg or jpg).\n",
"-s --size Pixel size of plots, \"width,height\"\n",
"\n",
"Options:\n",
" --help show this help message and exit\n",
" -a ANTIALIASING, --antialiasing=ANTIALIASING\n",
" To disable antialiasing set it to False\n",
" -h HEIGHT, --height=HEIGHT\n",
" Plot height in pixels\n",
" -w WIDTH, --width=WIDTH\n",
" Plot width in pixels\n",
" -r RESOLUTION, --resolution=RESOLUTION\n",
" Resolution in pixels per inch\n",
" -b BACKEND, --backend=BACKEND\n",
" Backend selection\n",
" -f FORMAT, --format=FORMAT\n",
" Plot format (png, svg or jpg).\n",
" -s SIZE, --size=SIZE Pixel size of plots, \"width,height\"\n"
]
}
],
"source": [
"%plot --help"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sci",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://metakernel.readthedocs.io/en/latest/source/README.html"
}
],
"mimetype": "text/x-scilab",
"name": "scilab",
"version": "0.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}