blob: 0c476d502b9100cba61f68114c56a12fa7258363 [file] [log] [blame]
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"itorch.image({image.lena(), image.lena(), image.lena()})"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"itorch.html('<p><b>Hi there!</b> this is arbitrary HTML</p>')\n",
"window_id = itorch.html('<p>This text will be replaced in 2 seconds</p>')\n",
"os.execute('sleep 2')\n",
"itorch.html('<p>magic!</p>', window_id)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Plot = require 'itorch.Plot'\n",
"x1 = torch.randn(40):mul(100)\n",
"y1 = torch.randn(40):mul(100)\n",
"x2 = torch.randn(40):mul(100)\n",
"y2 = torch.randn(40):mul(100)\n",
"x3 = torch.randn(40):mul(200)\n",
"y3 = torch.randn(40):mul(200)\n",
"\n",
"\n",
"-- scatter plots\n",
"plot = Plot():circle(x1, y1, 'red', 'hi'):circle(x2, y2, 'blue', 'bye'):draw()\n",
"plot:circle(x3,y3,'green', 'yolo'):redraw()\n",
"plot:title('Scatter Plot Demo'):redraw()\n",
"plot:xaxis('length'):yaxis('width'):redraw()\n",
"plot:legend(true)\n",
"plot:redraw()\n",
"-- print(plot:toHTML())\n",
"plot:save('out.html')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plot = Plot():line(x1, y1,'red','example'):legend(true):title('Line Plot Demo'):draw()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "iTorch",
"language": "lua",
"name": "KERNEL_NAME"
},
"language_info": {
"name": "lua",
"version": "5.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}