{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "2ed08531-0851-4cd0-97c8-a11f70058136",
"metadata": {
"tags": [],
"vscode": {
"languageId": "rust"
}
},
"outputs": [],
"source": [
":add rand regex plotters --features plotters/evcxr --default-features"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "798a5e69-b290-4f26-a711-f28fafa4dab8",
"metadata": {
"tags": [],
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"data": {
"text/html": [
"<div style=\"\"><svg width=\"640\" height=\"480\" viewBox=\"0 0 640 480\" xmlns=\"http://www.w3.org/2000/svg\">\n",
"<rect x=\"0\" y=\"0\" width=\"640\" height=\"480\" opacity=\"1\" fill=\"#FFFFFF\" stroke=\"none\"/>\n",
"<text x=\"320\" y=\"10\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"Arial\" font-size=\"40.32258064516129\" opacity=\"1\" fill=\"#000000\">\n",
"y=x^2\n",
"</text>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"444\" x2=\"35\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"40\" y1=\"444\" x2=\"40\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"46\" y1=\"444\" x2=\"46\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"52\" y1=\"444\" x2=\"52\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"58\" y1=\"444\" x2=\"58\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"64\" y1=\"444\" x2=\"64\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"70\" y1=\"444\" x2=\"70\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"76\" y1=\"444\" x2=\"76\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"82\" y1=\"444\" x2=\"82\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"88\" y1=\"444\" x2=\"88\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"94\" y1=\"444\" x2=\"94\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"100\" y1=\"444\" x2=\"100\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"106\" y1=\"444\" x2=\"106\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"112\" y1=\"444\" x2=\"112\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"118\" y1=\"444\" x2=\"118\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"124\" y1=\"444\" x2=\"124\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"130\" y1=\"444\" x2=\"130\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"136\" y1=\"444\" x2=\"136\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"142\" y1=\"444\" x2=\"142\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"148\" y1=\"444\" x2=\"148\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"154\" y1=\"444\" x2=\"154\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"160\" y1=\"444\" x2=\"160\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"166\" y1=\"444\" x2=\"166\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"172\" y1=\"444\" x2=\"172\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"178\" y1=\"444\" x2=\"178\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"184\" y1=\"444\" x2=\"184\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"190\" y1=\"444\" x2=\"190\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"196\" y1=\"444\" x2=\"196\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"202\" y1=\"444\" x2=\"202\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"208\" y1=\"444\" x2=\"208\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"214\" y1=\"444\" x2=\"214\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"220\" y1=\"444\" x2=\"220\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"226\" y1=\"444\" x2=\"226\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"232\" y1=\"444\" x2=\"232\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"238\" y1=\"444\" x2=\"238\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"244\" y1=\"444\" x2=\"244\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"250\" y1=\"444\" x2=\"250\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"256\" y1=\"444\" x2=\"256\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"262\" y1=\"444\" x2=\"262\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"268\" y1=\"444\" x2=\"268\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"274\" y1=\"444\" x2=\"274\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"280\" y1=\"444\" x2=\"280\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"286\" y1=\"444\" x2=\"286\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"292\" y1=\"444\" x2=\"292\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"298\" y1=\"444\" x2=\"298\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"304\" y1=\"444\" x2=\"304\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"310\" y1=\"444\" x2=\"310\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"316\" y1=\"444\" x2=\"316\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"322\" y1=\"444\" x2=\"322\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"328\" y1=\"444\" x2=\"328\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"334\" y1=\"444\" x2=\"334\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"340\" y1=\"444\" x2=\"340\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"346\" y1=\"444\" x2=\"346\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"352\" y1=\"444\" x2=\"352\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"358\" y1=\"444\" x2=\"358\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"364\" y1=\"444\" x2=\"364\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"370\" y1=\"444\" x2=\"370\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"376\" y1=\"444\" x2=\"376\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"382\" y1=\"444\" x2=\"382\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"388\" y1=\"444\" x2=\"388\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"394\" y1=\"444\" x2=\"394\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"400\" y1=\"444\" x2=\"400\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"406\" y1=\"444\" x2=\"406\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"412\" y1=\"444\" x2=\"412\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"418\" y1=\"444\" x2=\"418\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"424\" y1=\"444\" x2=\"424\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"430\" y1=\"444\" x2=\"430\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"436\" y1=\"444\" x2=\"436\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"442\" y1=\"444\" x2=\"442\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"448\" y1=\"444\" x2=\"448\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"454\" y1=\"444\" x2=\"454\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"460\" y1=\"444\" x2=\"460\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"466\" y1=\"444\" x2=\"466\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"472\" y1=\"444\" x2=\"472\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"478\" y1=\"444\" x2=\"478\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"484\" y1=\"444\" x2=\"484\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"490\" y1=\"444\" x2=\"490\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"496\" y1=\"444\" x2=\"496\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"502\" y1=\"444\" x2=\"502\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"508\" y1=\"444\" x2=\"508\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"514\" y1=\"444\" x2=\"514\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"520\" y1=\"444\" x2=\"520\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"526\" y1=\"444\" x2=\"526\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"532\" y1=\"444\" x2=\"532\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"538\" y1=\"444\" x2=\"538\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"544\" y1=\"444\" x2=\"544\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"550\" y1=\"444\" x2=\"550\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"556\" y1=\"444\" x2=\"556\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"562\" y1=\"444\" x2=\"562\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"568\" y1=\"444\" x2=\"568\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"574\" y1=\"444\" x2=\"574\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"580\" y1=\"444\" x2=\"580\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"586\" y1=\"444\" x2=\"586\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"592\" y1=\"444\" x2=\"592\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"598\" y1=\"444\" x2=\"598\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"604\" y1=\"444\" x2=\"604\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"610\" y1=\"444\" x2=\"610\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"616\" y1=\"444\" x2=\"616\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"622\" y1=\"444\" x2=\"622\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"628\" y1=\"444\" x2=\"628\" y2=\"55\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"444\" x2=\"634\" y2=\"444\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"437\" x2=\"634\" y2=\"437\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"430\" x2=\"634\" y2=\"430\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"423\" x2=\"634\" y2=\"423\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"416\" x2=\"634\" y2=\"416\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"409\" x2=\"634\" y2=\"409\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"402\" x2=\"634\" y2=\"402\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"395\" x2=\"634\" y2=\"395\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"388\" x2=\"634\" y2=\"388\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"381\" x2=\"634\" y2=\"381\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"374\" x2=\"634\" y2=\"374\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"367\" x2=\"634\" y2=\"367\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"360\" x2=\"634\" y2=\"360\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"353\" x2=\"634\" y2=\"353\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"345\" x2=\"634\" y2=\"345\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"338\" x2=\"634\" y2=\"338\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"331\" x2=\"634\" y2=\"331\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"324\" x2=\"634\" y2=\"324\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"317\" x2=\"634\" y2=\"317\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"310\" x2=\"634\" y2=\"310\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"303\" x2=\"634\" y2=\"303\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"296\" x2=\"634\" y2=\"296\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"289\" x2=\"634\" y2=\"289\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"282\" x2=\"634\" y2=\"282\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"275\" x2=\"634\" y2=\"275\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"268\" x2=\"634\" y2=\"268\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"261\" x2=\"634\" y2=\"261\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"254\" x2=\"634\" y2=\"254\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"246\" x2=\"634\" y2=\"246\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"239\" x2=\"634\" y2=\"239\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"232\" x2=\"634\" y2=\"232\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"225\" x2=\"634\" y2=\"225\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"218\" x2=\"634\" y2=\"218\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"211\" x2=\"634\" y2=\"211\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"204\" x2=\"634\" y2=\"204\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"197\" x2=\"634\" y2=\"197\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"190\" x2=\"634\" y2=\"190\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"183\" x2=\"634\" y2=\"183\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"176\" x2=\"634\" y2=\"176\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"169\" x2=\"634\" y2=\"169\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"162\" x2=\"634\" y2=\"162\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"155\" x2=\"634\" y2=\"155\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"147\" x2=\"634\" y2=\"147\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"140\" x2=\"634\" y2=\"140\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"133\" x2=\"634\" y2=\"133\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"126\" x2=\"634\" y2=\"126\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"119\" x2=\"634\" y2=\"119\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"112\" x2=\"634\" y2=\"112\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"105\" x2=\"634\" y2=\"105\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"98\" x2=\"634\" y2=\"98\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"91\" x2=\"634\" y2=\"91\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"84\" x2=\"634\" y2=\"84\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"77\" x2=\"634\" y2=\"77\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"70\" x2=\"634\" y2=\"70\"/>\n",
"<line opacity=\"0.1\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"63\" x2=\"634\" y2=\"63\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"444\" x2=\"35\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"94\" y1=\"444\" x2=\"94\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"154\" y1=\"444\" x2=\"154\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"214\" y1=\"444\" x2=\"214\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"274\" y1=\"444\" x2=\"274\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"334\" y1=\"444\" x2=\"334\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"394\" y1=\"444\" x2=\"394\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"454\" y1=\"444\" x2=\"454\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"514\" y1=\"444\" x2=\"514\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"574\" y1=\"444\" x2=\"574\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"634\" y1=\"444\" x2=\"634\" y2=\"55\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"409\" x2=\"634\" y2=\"409\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"338\" x2=\"634\" y2=\"338\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"268\" x2=\"634\" y2=\"268\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"197\" x2=\"634\" y2=\"197\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"126\" x2=\"634\" y2=\"126\"/>\n",
"<line opacity=\"0.2\" stroke=\"#000000\" stroke-width=\"1\" x1=\"35\" y1=\"55\" x2=\"634\" y2=\"55\"/>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"34,55 34,444 \"/>\n",
"<text x=\"25\" y=\"409\" dy=\"0.5ex\" text-anchor=\"end\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.0\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"29,409 34,409 \"/>\n",
"<text x=\"25\" y=\"338\" dy=\"0.5ex\" text-anchor=\"end\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.2\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"29,338 34,338 \"/>\n",
"<text x=\"25\" y=\"268\" dy=\"0.5ex\" text-anchor=\"end\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.4\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"29,268 34,268 \"/>\n",
"<text x=\"25\" y=\"197\" dy=\"0.5ex\" text-anchor=\"end\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.6\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"29,197 34,197 \"/>\n",
"<text x=\"25\" y=\"126\" dy=\"0.5ex\" text-anchor=\"end\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.8\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"29,126 34,126 \"/>\n",
"<text x=\"25\" y=\"55\" dy=\"0.5ex\" text-anchor=\"end\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"1.0\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"29,55 34,55 \"/>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"35,445 634,445 \"/>\n",
"<text x=\"35\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"-1.0\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"35,445 35,450 \"/>\n",
"<text x=\"94\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"-0.8\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"94,445 94,450 \"/>\n",
"<text x=\"154\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"-0.6\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"154,445 154,450 \"/>\n",
"<text x=\"214\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"-0.4\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"214,445 214,450 \"/>\n",
"<text x=\"274\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"-0.2\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"274,445 274,450 \"/>\n",
"<text x=\"334\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.0\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"334,445 334,450 \"/>\n",
"<text x=\"394\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.2\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"394,445 394,450 \"/>\n",
"<text x=\"454\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.4\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"454,445 454,450 \"/>\n",
"<text x=\"514\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.6\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"514,445 514,450 \"/>\n",
"<text x=\"574\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"0.8\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"574,445 574,450 \"/>\n",
"<text x=\"634\" y=\"455\" dy=\"0.76em\" text-anchor=\"middle\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"1.0\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#000000\" stroke-width=\"1\" points=\"634,445 634,450 \"/>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#FF0000\" stroke-width=\"1\" points=\"35,55 40,70 46,83 52,97 58,110 64,123 70,135 76,148 82,160 88,171 94,183 100,194 106,205 112,215 118,226 124,236 130,246 136,255 142,264 148,273 154,282 160,290 166,298 172,306 178,314 184,321 190,328 196,334 202,341 208,347 214,353 220,358 226,363 232,368 238,373 244,377 250,381 256,385 262,389 268,392 274,395 280,398 286,400 292,402 298,404 304,406 310,407 316,408 322,409 328,409 334,409 340,409 346,409 352,408 358,407 364,406 370,404 376,402 382,400 388,398 394,395 400,392 406,389 412,385 418,381 424,377 430,373 436,368 442,363 448,358 454,353 460,347 466,341 472,334 478,328 484,321 490,314 496,306 502,298 508,290 514,282 520,273 526,264 532,255 538,246 544,236 550,226 556,215 562,205 568,194 574,183 580,171 586,160 592,148 598,135 604,123 610,110 616,97 622,83 628,70 634,55 \"/>\n",
"<rect x=\"549\" y=\"235\" width=\"81\" height=\"29\" opacity=\"0.8\" fill=\"#FFFFFF\" stroke=\"none\"/>\n",
"<rect x=\"549\" y=\"235\" width=\"81\" height=\"29\" opacity=\"1\" fill=\"none\" stroke=\"#000000\"/>\n",
"<text x=\"589\" y=\"245\" dy=\"0.76em\" text-anchor=\"start\" font-family=\"sans-serif\" font-size=\"9.67741935483871\" opacity=\"1\" fill=\"#000000\">\n",
"y = x^2\n",
"</text>\n",
"<polyline fill=\"none\" opacity=\"1\" stroke=\"#FF0000\" stroke-width=\"1\" points=\"559,249 579,249 \"/>\n",
"</svg>\n",
"</div>\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"use plotters::prelude::*;\n",
"\n",
"let figure = evcxr_figure((640, 480), |root| {\n",
" root.fill(&WHITE);\n",
" let mut chart = ChartBuilder::on(&root)\n",
" .caption(\"y=x^2\", (\"Arial\", 50).into_font())\n",
" .margin(5)\n",
" .x_label_area_size(30)\n",
" .y_label_area_size(30)\n",
" .build_ranged(-1f32..1f32, -0.1f32..1f32)?;\n",
"\n",
" chart.configure_mesh().draw()?;\n",
"\n",
" chart.draw_series(LineSeries::new(\n",
" (-50..=50).map(|x| x as f32 / 50.0).map(|x| (x, x * x)),\n",
" &RED,\n",
" )).unwrap()\n",
" .label(\"y = x^2\")\n",
" .legend(|(x,y)| PathElement::new(vec![(x,y), (x + 20,y)], &RED));\n",
"\n",
" chart.configure_series_labels()\n",
" .background_style(&WHITE.mix(0.8))\n",
" .border_style(&BLACK)\n",
" .draw()?;\n",
" Ok(())\n",
"});\n",
"figure"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "IRust",
"language": "rust",
"name": "irust"
},
"language_info": {
"file_extension": ".rs",
"mimetype": "text/x-rust",
"name": "IRust"
}
},
"nbformat": 4,
"nbformat_minor": 5
}