2316 lines
126 KiB
Plaintext
2316 lines
126 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Displaying options\n",
|
|
"\n",
|
|
"The display behaviour of **Gnuplot.jl** depends on the value of the `Gnuplot.options.gpviewer` boolean option:\n",
|
|
"\n",
|
|
"- if `true` the plot is displayed in a gnuplot window, using one of the interactive terminals such as `wxt`, `qt` or `aqua`. There is exactly one window for each session, and the plots are updated by replacing the displayed image. The preferred terminal can optionally be set using `Gnuplot.options.term`;\n",
|
|
"\n",
|
|
"- if `false` the plot is displayed through the Julia [multimedia interface](https://docs.julialang.org/en/v1/base/io-network/#Multimedia-I/O-1), i.e. it is exported as either a `png`, `svg` or `html` file, and displayed in an external viewer. In this case the package is unable to replace a previous plot, hence each update results in a separate image being displayed. The terminal options to export the images are set in `Gnuplot.options.mime`.\n",
|
|
"\n",
|
|
"The latter approach can only be used when running a Jupyter, JupyterLab or Juno session, while the former approach is appropriate in all cases (most notably, for the standard Julia REPL). The `Gnuplot.options.gpviewer` flag is automatically set when the package is first loaded according to the runtime environment, however the user can change its value at any time to fit specific needs. The following examples show the difference between the two approaches. \n",
|
|
"\n",
|
|
"Recall that the `:-` symbol has a special meaning in **Gnuplot.jl**:\n",
|
|
"\n",
|
|
"- if given as first argument to a `@gp` or `@gsp` call, it append data and commands to a previously started plot. To start a new plot omit `:-` as first arugment;\n",
|
|
"- if given as last argument it avoids updating the current plot, although data and commands are saved to be used at a later time. To actually update a plot omit `:-` as last arugment.\n",
|
|
"\n",
|
|
"The `:-` symbol has been chosen since it reminds of hyphenation in natural language, and allow to split `@gp` and `@gsp` calls into multiple, possibly non-contiguous, statements.\n",
|
|
"\n",
|
|
"\n",
|
|
"## Display plots in a REPL session\n",
|
|
"Even if the following examples run in a notebook we can simulate a REPL session by explicitly setting `Gnuplot.options.gpviewer` to `true`:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"using Gnuplot\n",
|
|
"Gnuplot.options.gpviewer = true; # simulate usage in a REPL\n",
|
|
"\n",
|
|
"# Optionally, we can set a custom terminal for interactive use\n",
|
|
"Gnuplot.options.term = \"wxt size 800,400\";\n",
|
|
"\n",
|
|
"# Terminate all sessions\n",
|
|
"Gnuplot.quitall()\n",
|
|
"\n",
|
|
"# Generate some numbers to plot\n",
|
|
"x = 1:0.1:10\n",
|
|
"y1 = sin.(x)\n",
|
|
"y2 = cos.(x)\n",
|
|
"y3 = y1.+y2;"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Start a new plot using the `y1` dataset:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png": "",
|
|
"image/svg+xml": [],
|
|
"text/html": [],
|
|
"text/plain": []
|
|
},
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"@gp x y1 \"w l t 'sin'\" :-"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"As expected, nothing is displayed since we used the `:-` symbol as last argument to `@gp`.\n",
|
|
"Now add a second dataset (`y2`), and omit the trailing `:-` symbol:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png": "",
|
|
"image/svg+xml": [],
|
|
"text/html": [],
|
|
"text/plain": []
|
|
},
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"@gp :- x y2 \"w l t 'cos'\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"A new window should popup showing the plot with two datasets. Now add a third dataset (`y3`):"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"@gp :- x y3 \"w l t 'sin+cos' lw 2\";"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The plot has been updated by replacing the window content. The presence of the semicolon has no effect here, and the same applies when we involke `display()` on the returned value: "
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png": "",
|
|
"image/svg+xml": [],
|
|
"text/html": [],
|
|
"text/plain": []
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"display(ans) # nothing happens here"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Now insert the same `@gp` calls into a (possibly very long and complex) function, and invoke it:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"function complex_function()\n",
|
|
" # ...\n",
|
|
" x = 1:0.1:10\n",
|
|
" y1 = sin.(x)\n",
|
|
" y2 = cos.(x)\n",
|
|
" y3 = y1.+y2;\n",
|
|
" @gp :dummy x y1 \"w l t 'sin'\" :-\n",
|
|
" @gp :- :dummy x y2 \"w l t 'cos'\"\n",
|
|
" @gp :- :dummy x y3 \"w l t 'sin+cos' lw 2\";\n",
|
|
" #...\n",
|
|
" return nothing\n",
|
|
"end\n",
|
|
"\n",
|
|
"complex_function()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Here we used a separate session called `dummy` to show the plot in a separate window. Note that the same code, used in the REPL or within a function, generates the same plot. Also note that the plot is updated two times since there is no trailing `:-` symbol on both lines 8 and 9. We could slightly improve the performances by adding a trailing `:-` to line 8, and display the final plot in line 9 (although in this case the plot is too simple to produce any measurable improvement).\n",
|
|
"\n",
|
|
"\n",
|
|
"## Display plots in an external viewer\n",
|
|
"\n",
|
|
"Let's repeat the above examples redirecting the images on this notebook:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"Gnuplot.options.gpviewer = false; # use Julia multimedia interface\n",
|
|
"\n",
|
|
"#=\n",
|
|
"Gnuplot.jl export images using the following MIME types:\n",
|
|
"- image/png\n",
|
|
"- image/svg+xml\n",
|
|
"- text/html\n",
|
|
"and the corresponding terminal options are set through the `Gnuplot.options.mime` dictionary.\n",
|
|
"\n",
|
|
"Jupyter would store images in all such formats in the notebook. To shrink the notebook size\n",
|
|
"you may choose the format providing best results, and disable the others:\n",
|
|
"=#\n",
|
|
"Gnuplot.options.mime[MIME\"image/png\"] = \"\";\n",
|
|
"Gnuplot.options.mime[MIME\"image/svg+xml\"] = \"\";\n",
|
|
"Gnuplot.options.mime[MIME\"text/html\"] = \"svg enhanced standalone mouse size 800,400\";"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png": "",
|
|
"image/svg+xml": [],
|
|
"text/html": [],
|
|
"text/plain": []
|
|
},
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"@gp x y1 \"w l t 'sin'\" :-"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Again, the trailing `:-` symbol avoids creating a plot. If we omit it:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png": "",
|
|
"image/svg+xml": [],
|
|
"text/html": [
|
|
"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
|
|
"<svg onload=\"if (typeof(gnuplot_svg)!='undefined') gnuplot_svg.Init(evt)\" \n",
|
|
" width=\"800\" height=\"400\"\n",
|
|
" viewBox=\"0 0 800 400\"\n",
|
|
" xmlns=\"http://www.w3.org/2000/svg\"\n",
|
|
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
|
|
">\n",
|
|
"\n",
|
|
"<title>Gnuplot</title>\n",
|
|
"<desc>Produced by GNUPLOT 5.2 patchlevel 8 </desc>\n",
|
|
"\n",
|
|
"<script type=\"text/javascript\" > <![CDATA[\n",
|
|
"// Javascript routines for interaction with SVG documents produced by \n",
|
|
"// gnuplot's SVG terminal driver.\n",
|
|
"\n",
|
|
"// Find your root SVG element\n",
|
|
"var svg = document.querySelector('svg');\n",
|
|
"\n",
|
|
"// Create an SVGPoint for future math\n",
|
|
"var pt = svg.createSVGPoint();\n",
|
|
"\n",
|
|
"// Get point in global SVG space\n",
|
|
"function cursorPoint(evt){\n",
|
|
" pt.x = evt.clientX; pt.y = evt.clientY;\n",
|
|
" return pt.matrixTransform(svg.getScreenCTM().inverse());\n",
|
|
"}\n",
|
|
"\n",
|
|
"var gnuplot_svg = { };\n",
|
|
"\n",
|
|
"gnuplot_svg.version = \"17 February 2017\";\n",
|
|
"\n",
|
|
"gnuplot_svg.SVGDoc = null;\n",
|
|
"gnuplot_svg.SVGRoot = null;\n",
|
|
"\n",
|
|
"gnuplot_svg.Init = function(e)\n",
|
|
"{\n",
|
|
" gnuplot_svg.SVGDoc = e.target.ownerDocument;\n",
|
|
" gnuplot_svg.SVGRoot = gnuplot_svg.SVGDoc.documentElement;\n",
|
|
" gnuplot_svg.axisdate = new Date();\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleVisibility = function(evt, targetId)\n",
|
|
"{\n",
|
|
" var newTarget = evt.target;\n",
|
|
" if (targetId)\n",
|
|
" newTarget = gnuplot_svg.SVGDoc.getElementById(targetId);\n",
|
|
"\n",
|
|
" var newValue = newTarget.getAttributeNS(null, 'visibility')\n",
|
|
"\n",
|
|
" if ('hidden' != newValue)\n",
|
|
" newValue = 'hidden';\n",
|
|
" else\n",
|
|
" newValue = 'visible';\n",
|
|
"\n",
|
|
" newTarget.setAttributeNS(null, 'visibility', newValue);\n",
|
|
"\n",
|
|
" if (targetId) {\n",
|
|
" newTarget = gnuplot_svg.SVGDoc.getElementById(targetId.concat(\"_keyentry\"));\n",
|
|
" if (newTarget)\n",
|
|
" newTarget.setAttributeNS(null, 'style',\n",
|
|
"\t\tnewValue == 'hidden' ? 'filter:url(#greybox)' : 'none');\n",
|
|
" }\n",
|
|
"\n",
|
|
" evt.preventDefault();\n",
|
|
" evt.stopPropagation();\n",
|
|
"}\n",
|
|
"\n",
|
|
"// Mouse tracking echos coordinates to a floating text box\n",
|
|
"\n",
|
|
"gnuplot_svg.getText = function() {\n",
|
|
"\treturn(document.getElementById(\"coord_text\"));\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.updateCoordBox = function(t, evt) {\n",
|
|
" /* \n",
|
|
" * Apply screen CTM transformation to the evt screenX and screenY to get \n",
|
|
" * coordinates in SVG coordinate space. Use scaling parameters stored in\n",
|
|
" * the plot document by gnuplot to convert further into plot coordinates.\n",
|
|
" * Then position the floating text box using the SVG coordinates.\n",
|
|
" */\n",
|
|
" var m = document.documentElement.getScreenCTM();\n",
|
|
" var p = document.documentElement.createSVGPoint(); \n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" p.x = loc.x;\n",
|
|
" p.y = loc.y;\n",
|
|
" var label_x, label_y;\n",
|
|
"\n",
|
|
" // Allow for scrollbar position (Firefox, others?)\n",
|
|
" if (typeof evt.pageX != 'undefined') {\n",
|
|
" p.x = evt.pageX; p.y = evt.pageY; \n",
|
|
" }\n",
|
|
" t.setAttribute(\"x\", p.x);\n",
|
|
" t.setAttribute(\"y\", p.y);\n",
|
|
" \n",
|
|
" var plotcoord = gnuplot_svg.mouse2plot(p.x,p.y);\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_timeaxis_x == \"DMS\" || gnuplot_svg.plot_timeaxis_y == \"DMS\") {\n",
|
|
"\tif (gnuplot_svg.plot_timeaxis_x == \"DMS\")\n",
|
|
"\t label_x = gnuplot_svg.convert_to_DMS(x);\n",
|
|
"\telse\n",
|
|
"\t label_x = plotcoord.x.toFixed(2);\n",
|
|
"\tif (gnuplot_svg.plot_timeaxis_y == \"DMS\")\n",
|
|
"\t label_y = gnuplot_svg.convert_to_DMS(y);\n",
|
|
"\telse\n",
|
|
"\t label_y = plotcoord.y.toFixed(2);\n",
|
|
"\n",
|
|
" } else if (gnuplot_svg.polar_mode) {\n",
|
|
"\tpolar = gnuplot_svg.convert_to_polar(plotcoord.x,plotcoord.y);\n",
|
|
"\tlabel_x = \"ang= \" + polar.ang.toPrecision(4);\n",
|
|
"\tlabel_y = \"R= \" + polar.r.toPrecision(4);\n",
|
|
"\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"Date\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tvar year = gnuplot_svg.axisdate.getUTCFullYear();\n",
|
|
"\tvar month = gnuplot_svg.axisdate.getUTCMonth();\n",
|
|
"\tvar date = gnuplot_svg.axisdate.getUTCDate();\n",
|
|
"\tlabel_x = (\" \" + date).slice (-2) + \"/\"\n",
|
|
"\t\t+ (\"0\" + (month+1)).slice (-2) + \"/\"\n",
|
|
"\t\t+ year;\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"Time\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tvar hour = gnuplot_svg.axisdate.getUTCHours();\n",
|
|
"\tvar minute = gnuplot_svg.axisdate.getUTCMinutes();\n",
|
|
"\tvar second = gnuplot_svg.axisdate.getUTCSeconds();\n",
|
|
"\tlabel_x = (\"0\" + hour).slice (-2) + \":\" \n",
|
|
"\t\t+ (\"0\" + minute).slice (-2) + \":\"\n",
|
|
"\t\t+ (\"0\" + second).slice (-2);\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"DateTime\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tlabel_x = gnuplot_svg.axisdate.toUTCString();\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else {\n",
|
|
"\tlabel_x = plotcoord.x.toFixed(2);\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" }\n",
|
|
"\n",
|
|
" while (null != t.firstChild) {\n",
|
|
" \tt.removeChild(t.firstChild);\n",
|
|
" }\n",
|
|
" var textNode = document.createTextNode(\". \"+label_x+\" \"+label_y);\n",
|
|
" t.appendChild(textNode);\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t) {\n",
|
|
" \tt.setAttribute(\"visibility\", \"visible\");\n",
|
|
" \tgnuplot_svg.updateCoordBox(t, evt);\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.moveCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t)\n",
|
|
" \tgnuplot_svg.updateCoordBox(t, evt);\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.hideCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t)\n",
|
|
" \tt.setAttribute(\"visibility\", \"hidden\");\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t) {\n",
|
|
"\tvar state = t.getAttribute('visibility');\n",
|
|
"\tif ('hidden' != state)\n",
|
|
"\t state = 'hidden';\n",
|
|
"\telse\n",
|
|
"\t state = 'visible';\n",
|
|
"\tt.setAttribute('visibility', state);\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleGrid = function() {\n",
|
|
" if (!gnuplot_svg.SVGDoc.getElementsByClassName) // Old browsers\n",
|
|
"\treturn;\n",
|
|
" var grid = gnuplot_svg.SVGDoc.getElementsByClassName('gridline');\n",
|
|
" for (var i=0; i<grid.length; i++) {\n",
|
|
"\tvar state = grid[i].getAttribute('visibility');\n",
|
|
"\tgrid[i].setAttribute('visibility', (state == 'hidden') ? 'visible' : 'hidden');\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showHypertext = function(evt, mouseovertext)\n",
|
|
"{\n",
|
|
" var lines = mouseovertext.split('\\n');\n",
|
|
"\n",
|
|
" // If text starts with \"image:\" process it as an xlinked bitmap\n",
|
|
" if (lines[0].substring(0,5) == \"image\") {\n",
|
|
"\tvar nameindex = lines[0].indexOf(\":\");\n",
|
|
"\tif (nameindex > 0) {\n",
|
|
"\t gnuplot_svg.showHyperimage(evt, lines[0]);\n",
|
|
"\t lines[0] = lines[0].slice(nameindex+1);\n",
|
|
"\t}\n",
|
|
" }\n",
|
|
"\n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" var anchor_x = loc.x;\n",
|
|
" var anchor_y = loc.y;\n",
|
|
"\t\n",
|
|
" var hypertextbox = document.getElementById(\"hypertextbox\")\n",
|
|
" hypertextbox.setAttributeNS(null,\"x\",anchor_x+10);\n",
|
|
" hypertextbox.setAttributeNS(null,\"y\",anchor_y+4);\n",
|
|
" hypertextbox.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" var hypertext = document.getElementById(\"hypertext\")\n",
|
|
" hypertext.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
" hypertext.setAttributeNS(null,\"y\",anchor_y+18);\n",
|
|
" hypertext.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" var height = 2+16*lines.length;\n",
|
|
" hypertextbox.setAttributeNS(null,\"height\",height);\n",
|
|
" var length = hypertext.getComputedTextLength();\n",
|
|
" hypertextbox.setAttributeNS(null,\"width\",length+8);\n",
|
|
"\n",
|
|
" // bounce off frame bottom\n",
|
|
" if (anchor_y > gnuplot_svg.plot_ybot + 16 - height) {\n",
|
|
"\tanchor_y -= height;\n",
|
|
"\thypertextbox.setAttributeNS(null,\"y\",anchor_y+4);\n",
|
|
"\thypertext.setAttributeNS(null,\"y\",anchor_y+18);\n",
|
|
" }\n",
|
|
"\n",
|
|
" while (null != hypertext.firstChild) {\n",
|
|
" hypertext.removeChild(hypertext.firstChild);\n",
|
|
" }\n",
|
|
"\n",
|
|
" var textNode = document.createTextNode(lines[0]);\n",
|
|
"\n",
|
|
" if (lines.length <= 1) {\n",
|
|
"\thypertext.appendChild(textNode);\n",
|
|
" } else {\n",
|
|
"\txmlns=\"http://www.w3.org/2000/svg\";\n",
|
|
"\tvar tspan_element = document.createElementNS(xmlns, \"tspan\");\n",
|
|
"\ttspan_element.appendChild(textNode);\n",
|
|
"\thypertext.appendChild(tspan_element);\n",
|
|
"\tlength = tspan_element.getComputedTextLength();\n",
|
|
"\tvar ll = length;\n",
|
|
"\n",
|
|
"\tfor (var l=1; l<lines.length; l++) {\n",
|
|
"\t var tspan_element = document.createElementNS(xmlns, \"tspan\");\n",
|
|
"\t tspan_element.setAttributeNS(null,\"dy\", 16);\n",
|
|
"\t textNode = document.createTextNode(lines[l]);\n",
|
|
"\t tspan_element.appendChild(textNode);\n",
|
|
"\t hypertext.appendChild(tspan_element);\n",
|
|
"\n",
|
|
"\t ll = tspan_element.getComputedTextLength();\n",
|
|
"\t if (length < ll) length = ll;\n",
|
|
"\t}\n",
|
|
"\thypertextbox.setAttributeNS(null,\"width\",length+8);\n",
|
|
" }\n",
|
|
"\n",
|
|
" // bounce off right edge\n",
|
|
" if (anchor_x > gnuplot_svg.plot_xmax + 14 - length) {\n",
|
|
"\tanchor_x -= length;\n",
|
|
"\thypertextbox.setAttributeNS(null,\"x\",anchor_x+10);\n",
|
|
"\thypertext.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
" }\n",
|
|
"\n",
|
|
" // left-justify multiline text\n",
|
|
" var tspan_element = hypertext.firstChild;\n",
|
|
" while (tspan_element) {\n",
|
|
"\ttspan_element.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
"\ttspan_element = tspan_element.nextElementSibling;\n",
|
|
" }\n",
|
|
"\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.hideHypertext = function ()\n",
|
|
"{\n",
|
|
" var hypertextbox = document.getElementById(\"hypertextbox\")\n",
|
|
" var hypertext = document.getElementById(\"hypertext\")\n",
|
|
" var hyperimage = document.getElementById(\"hyperimage\")\n",
|
|
" hypertextbox.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
" hypertext.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
" hyperimage.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showHyperimage = function(evt, linktext)\n",
|
|
"{\n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" var anchor_x = loc.x;\n",
|
|
" var anchor_y = loc.y;\n",
|
|
" // Allow for scrollbar position (Firefox, others?)\n",
|
|
" if (typeof evt.pageX != 'undefined') {\n",
|
|
" anchor_x = evt.pageX; anchor_y = evt.pageY; \n",
|
|
" }\n",
|
|
"\n",
|
|
" var hyperimage = document.getElementById(\"hyperimage\")\n",
|
|
" hyperimage.setAttributeNS(null,\"x\",anchor_x);\n",
|
|
" hyperimage.setAttributeNS(null,\"y\",anchor_y);\n",
|
|
" hyperimage.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" // Pick up height and width from \"image(width,height):name\"\n",
|
|
" var width = hyperimage.getAttributeNS(null,\"width\");\n",
|
|
" var height = hyperimage.getAttributeNS(null,\"height\");\n",
|
|
" if (linktext.charAt(5) == \"(\") {\n",
|
|
"\twidth = parseInt(linktext.slice(6));\n",
|
|
"\theight = parseInt(linktext.slice(linktext.indexOf(\",\") + 1));\n",
|
|
"\thyperimage.setAttributeNS(null,\"width\",width);\n",
|
|
"\thyperimage.setAttributeNS(null,\"height\",height);\n",
|
|
"\thyperimage.setAttributeNS(null,\"preserveAspectRatio\",\"none\");\n",
|
|
" }\n",
|
|
"\n",
|
|
" // bounce off frame bottom and right\n",
|
|
" if (anchor_y > gnuplot_svg.plot_ybot + 50 - height)\n",
|
|
"\thyperimage.setAttributeNS(null,\"y\",20 + anchor_y-height);\n",
|
|
" if (anchor_x > gnuplot_svg.plot_xmax + 150 - width)\n",
|
|
"\thyperimage.setAttributeNS(null,\"x\",10 + anchor_x-width);\n",
|
|
"\n",
|
|
" // attach image URL as a link\n",
|
|
" linktext = linktext.slice(linktext.indexOf(\":\") + 1);\n",
|
|
" var xlinkns = \"http://www.w3.org/1999/xlink\";\n",
|
|
" hyperimage.setAttributeNS(xlinkns,\"xlink:href\",linktext);\n",
|
|
"}\n",
|
|
"\n",
|
|
"// Convert from svg panel mouse coordinates to the coordinate\n",
|
|
"// system of the gnuplot figure\n",
|
|
"gnuplot_svg.mouse2plot = function(mousex,mousey) {\n",
|
|
" var plotcoord = new Object;\n",
|
|
" var plotx = mousex - gnuplot_svg.plot_xmin;\n",
|
|
" var ploty = mousey - gnuplot_svg.plot_ybot;\n",
|
|
" var x,y;\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_logaxis_x != 0) {\n",
|
|
"\tx = Math.log(gnuplot_svg.plot_axis_xmax)\n",
|
|
"\t - Math.log(gnuplot_svg.plot_axis_xmin);\n",
|
|
"\tx = x * (plotx / (gnuplot_svg.plot_xmax - gnuplot_svg.plot_xmin))\n",
|
|
"\t + Math.log(gnuplot_svg.plot_axis_xmin);\n",
|
|
"\tx = Math.exp(x);\n",
|
|
" } else {\n",
|
|
"\tx = gnuplot_svg.plot_axis_xmin + (plotx / (gnuplot_svg.plot_xmax-gnuplot_svg.plot_xmin)) * (gnuplot_svg.plot_axis_xmax - gnuplot_svg.plot_axis_xmin);\n",
|
|
" }\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_logaxis_y != 0) {\n",
|
|
"\ty = Math.log(gnuplot_svg.plot_axis_ymax)\n",
|
|
"\t - Math.log(gnuplot_svg.plot_axis_ymin);\n",
|
|
"\ty = y * (ploty / (gnuplot_svg.plot_ytop - gnuplot_svg.plot_ybot))\n",
|
|
"\t + Math.log(gnuplot_svg.plot_axis_ymin);\n",
|
|
"\ty = Math.exp(y);\n",
|
|
" } else {\n",
|
|
"\ty = gnuplot_svg.plot_axis_ymin + (ploty / (gnuplot_svg.plot_ytop-gnuplot_svg.plot_ybot)) * (gnuplot_svg.plot_axis_ymax - gnuplot_svg.plot_axis_ymin);\n",
|
|
" }\n",
|
|
"\n",
|
|
" plotcoord.x = x;\n",
|
|
" plotcoord.y = y;\n",
|
|
" return plotcoord;\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.convert_to_polar = function (x,y)\n",
|
|
"{\n",
|
|
" polar = new Object;\n",
|
|
" var phi, r;\n",
|
|
" phi = Math.atan2(y,x);\n",
|
|
" if (gnuplot_svg.plot_logaxis_r) \n",
|
|
" r = Math.exp( (x/Math.cos(phi) + Math.log(gnuplot_svg.plot_axis_rmin)/Math.LN10) * Math.LN10);\n",
|
|
" else if (gnuplot_svg.plot_axis_rmin > gnuplot_svg.plot_axis_rmax)\n",
|
|
" r = gnuplot_svg.plot_axis_rmin - x/Math.cos(phi);\n",
|
|
" else\n",
|
|
" r = gnuplot_svg.plot_axis_rmin + x/Math.cos(phi);\n",
|
|
" phi = phi * (180./Math.PI);\n",
|
|
" if (gnuplot_svg.polar_sense < 0)\n",
|
|
"\tphi = -phi;\n",
|
|
" if (gnuplot_svg.polar_theta0 != undefined)\n",
|
|
"\tphi = phi + gnuplot_svg.polar_theta0;\n",
|
|
" if (phi > 180.)\n",
|
|
"\tphi = phi - 360.;\n",
|
|
" polar.r = r;\n",
|
|
" polar.ang = phi;\n",
|
|
" return polar;\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.convert_to_DMS = function (x)\n",
|
|
"{\n",
|
|
" var dms = {d:0, m:0, s:0};\n",
|
|
" var deg = Math.abs(x);\n",
|
|
" dms.d = Math.floor(deg);\n",
|
|
" dms.m = Math.floor((deg - dms.d) * 60.);\n",
|
|
" dms.s = Math.floor((deg - dms.d) * 3600. - dms.m * 60.);\n",
|
|
" fmt = ((x<0)?\"-\":\" \")\n",
|
|
" + dms.d.toFixed(0) + \"°\"\n",
|
|
"\t+ dms.m.toFixed(0) + \"\\\"\"\n",
|
|
"\t+ dms.s.toFixed(0) + \"'\";\n",
|
|
" return fmt;\n",
|
|
"}\n",
|
|
"]]>\n",
|
|
"</script>\n",
|
|
"\n",
|
|
"<!-- Tie mousing to entire bounding box of the plot -->\n",
|
|
"<rect x=\"0\" y=\"0\" width=\"800\" height=\"400\" fill=\"#ffffff\" stroke=\"black\" stroke-width=\"1\"\n",
|
|
"onclick=\"gnuplot_svg.toggleCoordBox(evt)\" onmousemove=\"gnuplot_svg.moveCoordBox(evt)\"/>\n",
|
|
"\n",
|
|
"<!-- Also track mouse when it is on a plot element -->\n",
|
|
"<g id=\"gnuplot_canvas\" onclick=\"gnuplot_svg.toggleCoordBox(evt)\" onmousemove=\"gnuplot_svg.moveCoordBox(evt)\">\n",
|
|
"\n",
|
|
"<defs>\n",
|
|
"\n",
|
|
"\t<circle id='gpDot' r='0.5' stroke-width='0.5' stroke='currentColor'/>\n",
|
|
"\t<path id='gpPt0' stroke-width='0.222' stroke='currentColor' d='M-1,0 h2 M0,-1 v2'/>\n",
|
|
"\t<path id='gpPt1' stroke-width='0.222' stroke='currentColor' d='M-1,-1 L1,1 M1,-1 L-1,1'/>\n",
|
|
"\t<path id='gpPt2' stroke-width='0.222' stroke='currentColor' d='M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1'/>\n",
|
|
"\t<rect id='gpPt3' stroke-width='0.222' stroke='currentColor' x='-1' y='-1' width='2' height='2'/>\n",
|
|
"\t<rect id='gpPt4' stroke-width='0.222' stroke='currentColor' fill='currentColor' x='-1' y='-1' width='2' height='2'/>\n",
|
|
"\t<circle id='gpPt5' stroke-width='0.222' stroke='currentColor' cx='0' cy='0' r='1'/>\n",
|
|
"\t<use xlink:href='#gpPt5' id='gpPt6' fill='currentColor' stroke='none'/>\n",
|
|
"\t<path id='gpPt7' stroke-width='0.222' stroke='currentColor' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'/>\n",
|
|
"\t<use xlink:href='#gpPt7' id='gpPt8' fill='currentColor' stroke='none'/>\n",
|
|
"\t<use xlink:href='#gpPt7' id='gpPt9' stroke='currentColor' transform='rotate(180)'/>\n",
|
|
"\t<use xlink:href='#gpPt9' id='gpPt10' fill='currentColor' stroke='none'/>\n",
|
|
"\t<use xlink:href='#gpPt3' id='gpPt11' stroke='currentColor' transform='rotate(45)'/>\n",
|
|
"\t<use xlink:href='#gpPt11' id='gpPt12' fill='currentColor' stroke='none'/>\n",
|
|
"\t<path id='gpPt13' stroke-width='0.222' stroke='currentColor' d='M0,1.330 L1.265,0.411 L0.782,-1.067 L-0.782,-1.076 L-1.265,0.411 z'/>\n",
|
|
"\t<use xlink:href='#gpPt13' id='gpPt14' fill='currentColor' stroke='none'/>\n",
|
|
"\t<filter id='textbox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>\n",
|
|
"\t <feFlood flood-color='white' flood-opacity='1' result='bgnd'/>\n",
|
|
"\t <feComposite in='SourceGraphic' in2='bgnd' operator='atop'/>\n",
|
|
"\t</filter>\n",
|
|
"\t<filter id='greybox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>\n",
|
|
"\t <feFlood flood-color='lightgrey' flood-opacity='1' result='grey'/>\n",
|
|
"\t <feComposite in='SourceGraphic' in2='grey' operator='atop'/>\n",
|
|
"\t</filter>\n",
|
|
"</defs>\n",
|
|
"<g fill=\"none\" color=\"white\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,364.0 L62.9,364.0 M775.0,364.0 L766.0,364.0 '/>\t<g transform=\"translate(45.6,367.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,329.4 L62.9,329.4 M775.0,329.4 L766.0,329.4 '/>\t<g transform=\"translate(45.6,333.3)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-0.8</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,294.8 L62.9,294.8 M775.0,294.8 L766.0,294.8 '/>\t<g transform=\"translate(45.6,298.7)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-0.6</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,260.2 L62.9,260.2 M775.0,260.2 L766.0,260.2 '/>\t<g transform=\"translate(45.6,264.1)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-0.4</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,225.6 L62.9,225.6 M775.0,225.6 L766.0,225.6 '/>\t<g transform=\"translate(45.6,229.5)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-0.2</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,191.0 L62.9,191.0 M775.0,191.0 L766.0,191.0 '/>\t<g transform=\"translate(45.6,194.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,156.5 L62.9,156.5 M775.0,156.5 L766.0,156.5 '/>\t<g transform=\"translate(45.6,160.4)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0.2</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,121.9 L62.9,121.9 M775.0,121.9 L766.0,121.9 '/>\t<g transform=\"translate(45.6,125.8)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0.4</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,87.3 L62.9,87.3 M775.0,87.3 L766.0,87.3 '/>\t<g transform=\"translate(45.6,91.2)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0.6</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,52.7 L62.9,52.7 M775.0,52.7 L766.0,52.7 '/>\t<g transform=\"translate(45.6,56.6)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0.8</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L62.9,18.1 M775.0,18.1 L766.0,18.1 '/>\t<g transform=\"translate(45.6,22.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,364.0 L53.9,355.0 M53.9,18.1 L53.9,27.1 '/>\t<g transform=\"translate(53.9,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M134.0,364.0 L134.0,355.0 M134.0,18.1 L134.0,27.1 '/>\t<g transform=\"translate(134.0,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 2</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M214.1,364.0 L214.1,355.0 M214.1,18.1 L214.1,27.1 '/>\t<g transform=\"translate(214.1,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 3</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M294.3,364.0 L294.3,355.0 M294.3,18.1 L294.3,27.1 '/>\t<g transform=\"translate(294.3,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 4</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M374.4,364.0 L374.4,355.0 M374.4,18.1 L374.4,27.1 '/>\t<g transform=\"translate(374.4,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M454.5,364.0 L454.5,355.0 M454.5,18.1 L454.5,27.1 '/>\t<g transform=\"translate(454.5,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 6</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M534.6,364.0 L534.6,355.0 M534.6,18.1 L534.6,27.1 '/>\t<g transform=\"translate(534.6,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 7</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M614.8,364.0 L614.8,355.0 M614.8,18.1 L614.8,27.1 '/>\t<g transform=\"translate(614.8,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 8</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M694.9,364.0 L694.9,355.0 M694.9,18.1 L694.9,27.1 '/>\t<g transform=\"translate(694.9,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 9</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M775.0,364.0 L775.0,355.0 M775.0,18.1 L775.0,27.1 '/>\t<g transform=\"translate(775.0,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 10</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L53.9,364.0 L775.0,364.0 L775.0,18.1 L53.9,18.1 Z '/></g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"\t<g id=\"gnuplot_plot_1\" ><title>sin</title>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_1_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_1')\">\n",
|
|
"\t<g transform=\"translate(707.9,40.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >sin</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb(148, 0, 211)' d='M716.2,36.1 L758.4,36.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb(148, 0, 211)' d='M53.9,45.5 L61.9,36.9 L69.9,29.9 L77.9,24.4 L85.9,20.6 L94.0,18.5 L102.0,18.2 L110.0,19.5\n",
|
|
"\t\tL118.0,22.6 L126.0,27.4 L134.0,33.8 L142.0,41.8 L150.0,51.2 L158.1,62.1 L166.1,74.2 L174.1,87.5\n",
|
|
"\t\tL182.1,101.9 L190.1,117.1 L198.1,133.1 L206.1,149.7 L214.1,166.6 L222.2,183.9 L230.2,201.1 L238.2,218.3\n",
|
|
"\t\tL246.2,235.2 L254.2,251.7 L262.2,267.6 L270.2,282.7 L278.2,296.9 L286.3,310.0 L294.3,321.9 L302.3,332.6\n",
|
|
"\t\tL310.3,341.8 L318.3,349.5 L326.3,355.6 L334.3,360.1 L342.3,362.9 L350.4,364.0 L358.4,363.3 L366.4,361.0\n",
|
|
"\t\tL374.4,356.9 L382.4,351.2 L390.4,343.8 L398.4,335.0 L406.4,324.7 L414.5,313.1 L422.5,300.2 L430.5,286.3\n",
|
|
"\t\tL438.5,271.4 L446.5,255.7 L454.5,239.4 L462.5,222.6 L470.5,205.4 L478.5,188.1 L486.6,170.9 L494.6,153.8\n",
|
|
"\t\tL502.6,137.2 L510.6,121.0 L518.6,105.6 L526.6,91.0 L534.6,77.4 L542.6,65.0 L550.7,53.8 L558.7,44.0\n",
|
|
"\t\tL566.7,35.6 L574.7,28.8 L582.7,23.6 L590.7,20.1 L598.7,18.4 L606.7,18.3 L614.8,19.9 L622.8,23.3\n",
|
|
"\t\tL630.8,28.4 L638.8,35.0 L646.8,43.2 L654.8,53.0 L662.8,64.0 L670.8,76.4 L678.9,89.9 L686.9,104.4\n",
|
|
"\t\tL694.9,119.8 L702.9,135.9 L710.9,152.5 L718.9,169.5 L726.9,186.8 L734.9,204.0 L743.0,221.2 L751.0,238.1\n",
|
|
"\t\tL759.0,254.4 L767.0,270.2 L775.0,285.1 '/></g>\n",
|
|
"\t</g>\n",
|
|
"\t<g id=\"gnuplot_plot_2\" ><title>cos</title>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_2_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_2')\">\n",
|
|
"\t<g transform=\"translate(707.9,58.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >cos</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb( 0, 158, 115)' d='M716.2,54.1 L758.4,54.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb( 0, 158, 115)' d='M53.9,97.6 L61.9,112.6 L69.9,128.4 L77.9,144.8 L85.9,161.7 L94.0,178.8 L102.0,196.1 L110.0,213.3\n",
|
|
"\t\tL118.0,230.3 L126.0,247.0 L134.0,263.0 L142.0,278.4 L150.0,292.8 L158.1,306.3 L166.1,318.6 L174.1,329.6\n",
|
|
"\t\tL182.1,339.2 L190.1,347.4 L198.1,354.0 L206.1,359.0 L214.1,362.3 L222.2,363.9 L230.2,363.7 L238.2,361.8\n",
|
|
"\t\tL246.2,358.3 L254.2,353.0 L262.2,346.1 L270.2,337.7 L278.2,327.8 L286.3,316.6 L294.3,304.1 L302.3,290.5\n",
|
|
"\t\tL310.3,275.8 L318.3,260.4 L326.3,244.2 L334.3,227.5 L342.3,210.4 L350.4,193.2 L358.4,175.9 L366.4,158.8\n",
|
|
"\t\tL374.4,142.0 L382.4,125.7 L390.4,110.0 L398.4,95.2 L406.4,81.3 L414.5,68.5 L422.5,56.9 L430.5,46.7\n",
|
|
"\t\tL438.5,37.9 L446.5,30.6 L454.5,25.0 L462.5,21.0 L470.5,18.7 L478.5,18.1 L486.6,19.3 L494.6,22.1\n",
|
|
"\t\tL502.6,26.7 L510.6,32.9 L518.6,40.7 L526.6,50.0 L534.6,60.7 L542.6,72.7 L550.7,85.8 L558.7,100.1\n",
|
|
"\t\tL566.7,115.2 L574.7,131.1 L582.7,147.6 L590.7,164.5 L598.7,181.7 L606.7,199.0 L614.8,216.2 L622.8,233.2\n",
|
|
"\t\tL630.8,249.7 L638.8,265.7 L646.8,280.9 L654.8,295.2 L662.8,308.4 L670.8,320.5 L678.9,331.3 L686.9,340.7\n",
|
|
"\t\tL694.9,348.6 L702.9,355.0 L710.9,359.6 L718.9,362.7 L726.9,363.9 L734.9,363.5 L743.0,361.4 L751.0,357.5\n",
|
|
"\t\tL759.0,352.0 L767.0,344.8 L775.0,336.2 '/></g>\n",
|
|
"\t</g>\n",
|
|
"<g fill=\"none\" color=\"white\" stroke=\"rgb( 0, 158, 115)\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"black\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L53.9,364.0 L775.0,364.0 L775.0,18.1 L53.9,18.1 Z '/></g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"\n",
|
|
"<script type=\"text/javascript\"><![CDATA[\n",
|
|
"// plot boundaries and axis scaling information for mousing \n",
|
|
"gnuplot_svg.plot_term_xmax = 800;\n",
|
|
"gnuplot_svg.plot_term_ymax = 400;\n",
|
|
"gnuplot_svg.plot_xmin = 53.9;\n",
|
|
"gnuplot_svg.plot_xmax = 775.0;\n",
|
|
"gnuplot_svg.plot_ybot = 364.0;\n",
|
|
"gnuplot_svg.plot_ytop = 18.1;\n",
|
|
"gnuplot_svg.plot_width = 721.1;\n",
|
|
"gnuplot_svg.plot_height = 345.9;\n",
|
|
"gnuplot_svg.plot_axis_xmin = 1;\n",
|
|
"gnuplot_svg.plot_axis_xmax = 10;\n",
|
|
"gnuplot_svg.plot_axis_ymin = -1;\n",
|
|
"gnuplot_svg.plot_axis_ymax = 1;\n",
|
|
"gnuplot_svg.polar_mode = false;\n",
|
|
"gnuplot_svg.plot_axis_x2min = \"none\"\n",
|
|
"gnuplot_svg.plot_axis_y2min = \"none\"\n",
|
|
"gnuplot_svg.plot_logaxis_x = 0;\n",
|
|
"gnuplot_svg.plot_logaxis_y = 0;\n",
|
|
"gnuplot_svg.plot_timeaxis_x = \"\";\n",
|
|
"gnuplot_svg.plot_timeaxis_y = \"\";\n",
|
|
"]]>\n",
|
|
"</script>\n",
|
|
"</g>\n",
|
|
"\n",
|
|
" <text id=\"coord_text\" text-anchor=\"start\" pointer-events=\"none\"\n",
|
|
" font-size=\"12\" font-family=\"Arial\"\n",
|
|
" visibility=\"hidden\"> </text>\n",
|
|
"\n",
|
|
" <rect id=\"hypertextbox\" class=\"hypertextbox\" pointer-events=\"none\"\n",
|
|
" fill=\"white\" stroke=\"black\" opacity=\"0.8\"\n",
|
|
" height=\"16\" visibility=\"hidden\" />\n",
|
|
"\n",
|
|
" <text id=\"hypertext\" class=\"hypertext\" pointer-events=\"none\"\n",
|
|
" font-size=\"12\" font-family=\"Arial\"\n",
|
|
" visibility=\"hidden\"> </text>\n",
|
|
"\n",
|
|
" <image id=\"hyperimage\" class=\"hyperimage\" pointer-events=\"none\"\n",
|
|
" fill=\"white\" stroke=\"black\" opacity=\"0.8\"\n",
|
|
" height=\"200\" width=\"300\" visibility=\"hidden\" />\n",
|
|
"</svg>\n",
|
|
"\n"
|
|
],
|
|
"text/plain": []
|
|
},
|
|
"execution_count": 9,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"@gp :- x y2 \"w l t 'cos'\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"we obtain an inline plot with two datasets. Now the third dataset:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"@gp :- x y3 \"w l t 'sin+cos' lw 2\";"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"According to the Julia convention, no plot is shown here since we added a trailing `;`, however all data have already been sent to gnuplot.\n",
|
|
"\n",
|
|
"To display the updated plot we need an explicit call to `display()` on the returned value:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png": "",
|
|
"image/svg+xml": [],
|
|
"text/html": [
|
|
"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
|
|
"<svg onload=\"if (typeof(gnuplot_svg)!='undefined') gnuplot_svg.Init(evt)\" \n",
|
|
" width=\"800\" height=\"400\"\n",
|
|
" viewBox=\"0 0 800 400\"\n",
|
|
" xmlns=\"http://www.w3.org/2000/svg\"\n",
|
|
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
|
|
">\n",
|
|
"\n",
|
|
"<title>Gnuplot</title>\n",
|
|
"<desc>Produced by GNUPLOT 5.2 patchlevel 8 </desc>\n",
|
|
"\n",
|
|
"<script type=\"text/javascript\" > <![CDATA[\n",
|
|
"// Javascript routines for interaction with SVG documents produced by \n",
|
|
"// gnuplot's SVG terminal driver.\n",
|
|
"\n",
|
|
"// Find your root SVG element\n",
|
|
"var svg = document.querySelector('svg');\n",
|
|
"\n",
|
|
"// Create an SVGPoint for future math\n",
|
|
"var pt = svg.createSVGPoint();\n",
|
|
"\n",
|
|
"// Get point in global SVG space\n",
|
|
"function cursorPoint(evt){\n",
|
|
" pt.x = evt.clientX; pt.y = evt.clientY;\n",
|
|
" return pt.matrixTransform(svg.getScreenCTM().inverse());\n",
|
|
"}\n",
|
|
"\n",
|
|
"var gnuplot_svg = { };\n",
|
|
"\n",
|
|
"gnuplot_svg.version = \"17 February 2017\";\n",
|
|
"\n",
|
|
"gnuplot_svg.SVGDoc = null;\n",
|
|
"gnuplot_svg.SVGRoot = null;\n",
|
|
"\n",
|
|
"gnuplot_svg.Init = function(e)\n",
|
|
"{\n",
|
|
" gnuplot_svg.SVGDoc = e.target.ownerDocument;\n",
|
|
" gnuplot_svg.SVGRoot = gnuplot_svg.SVGDoc.documentElement;\n",
|
|
" gnuplot_svg.axisdate = new Date();\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleVisibility = function(evt, targetId)\n",
|
|
"{\n",
|
|
" var newTarget = evt.target;\n",
|
|
" if (targetId)\n",
|
|
" newTarget = gnuplot_svg.SVGDoc.getElementById(targetId);\n",
|
|
"\n",
|
|
" var newValue = newTarget.getAttributeNS(null, 'visibility')\n",
|
|
"\n",
|
|
" if ('hidden' != newValue)\n",
|
|
" newValue = 'hidden';\n",
|
|
" else\n",
|
|
" newValue = 'visible';\n",
|
|
"\n",
|
|
" newTarget.setAttributeNS(null, 'visibility', newValue);\n",
|
|
"\n",
|
|
" if (targetId) {\n",
|
|
" newTarget = gnuplot_svg.SVGDoc.getElementById(targetId.concat(\"_keyentry\"));\n",
|
|
" if (newTarget)\n",
|
|
" newTarget.setAttributeNS(null, 'style',\n",
|
|
"\t\tnewValue == 'hidden' ? 'filter:url(#greybox)' : 'none');\n",
|
|
" }\n",
|
|
"\n",
|
|
" evt.preventDefault();\n",
|
|
" evt.stopPropagation();\n",
|
|
"}\n",
|
|
"\n",
|
|
"// Mouse tracking echos coordinates to a floating text box\n",
|
|
"\n",
|
|
"gnuplot_svg.getText = function() {\n",
|
|
"\treturn(document.getElementById(\"coord_text\"));\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.updateCoordBox = function(t, evt) {\n",
|
|
" /* \n",
|
|
" * Apply screen CTM transformation to the evt screenX and screenY to get \n",
|
|
" * coordinates in SVG coordinate space. Use scaling parameters stored in\n",
|
|
" * the plot document by gnuplot to convert further into plot coordinates.\n",
|
|
" * Then position the floating text box using the SVG coordinates.\n",
|
|
" */\n",
|
|
" var m = document.documentElement.getScreenCTM();\n",
|
|
" var p = document.documentElement.createSVGPoint(); \n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" p.x = loc.x;\n",
|
|
" p.y = loc.y;\n",
|
|
" var label_x, label_y;\n",
|
|
"\n",
|
|
" // Allow for scrollbar position (Firefox, others?)\n",
|
|
" if (typeof evt.pageX != 'undefined') {\n",
|
|
" p.x = evt.pageX; p.y = evt.pageY; \n",
|
|
" }\n",
|
|
" t.setAttribute(\"x\", p.x);\n",
|
|
" t.setAttribute(\"y\", p.y);\n",
|
|
" \n",
|
|
" var plotcoord = gnuplot_svg.mouse2plot(p.x,p.y);\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_timeaxis_x == \"DMS\" || gnuplot_svg.plot_timeaxis_y == \"DMS\") {\n",
|
|
"\tif (gnuplot_svg.plot_timeaxis_x == \"DMS\")\n",
|
|
"\t label_x = gnuplot_svg.convert_to_DMS(x);\n",
|
|
"\telse\n",
|
|
"\t label_x = plotcoord.x.toFixed(2);\n",
|
|
"\tif (gnuplot_svg.plot_timeaxis_y == \"DMS\")\n",
|
|
"\t label_y = gnuplot_svg.convert_to_DMS(y);\n",
|
|
"\telse\n",
|
|
"\t label_y = plotcoord.y.toFixed(2);\n",
|
|
"\n",
|
|
" } else if (gnuplot_svg.polar_mode) {\n",
|
|
"\tpolar = gnuplot_svg.convert_to_polar(plotcoord.x,plotcoord.y);\n",
|
|
"\tlabel_x = \"ang= \" + polar.ang.toPrecision(4);\n",
|
|
"\tlabel_y = \"R= \" + polar.r.toPrecision(4);\n",
|
|
"\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"Date\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tvar year = gnuplot_svg.axisdate.getUTCFullYear();\n",
|
|
"\tvar month = gnuplot_svg.axisdate.getUTCMonth();\n",
|
|
"\tvar date = gnuplot_svg.axisdate.getUTCDate();\n",
|
|
"\tlabel_x = (\" \" + date).slice (-2) + \"/\"\n",
|
|
"\t\t+ (\"0\" + (month+1)).slice (-2) + \"/\"\n",
|
|
"\t\t+ year;\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"Time\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tvar hour = gnuplot_svg.axisdate.getUTCHours();\n",
|
|
"\tvar minute = gnuplot_svg.axisdate.getUTCMinutes();\n",
|
|
"\tvar second = gnuplot_svg.axisdate.getUTCSeconds();\n",
|
|
"\tlabel_x = (\"0\" + hour).slice (-2) + \":\" \n",
|
|
"\t\t+ (\"0\" + minute).slice (-2) + \":\"\n",
|
|
"\t\t+ (\"0\" + second).slice (-2);\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"DateTime\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tlabel_x = gnuplot_svg.axisdate.toUTCString();\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else {\n",
|
|
"\tlabel_x = plotcoord.x.toFixed(2);\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" }\n",
|
|
"\n",
|
|
" while (null != t.firstChild) {\n",
|
|
" \tt.removeChild(t.firstChild);\n",
|
|
" }\n",
|
|
" var textNode = document.createTextNode(\". \"+label_x+\" \"+label_y);\n",
|
|
" t.appendChild(textNode);\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t) {\n",
|
|
" \tt.setAttribute(\"visibility\", \"visible\");\n",
|
|
" \tgnuplot_svg.updateCoordBox(t, evt);\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.moveCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t)\n",
|
|
" \tgnuplot_svg.updateCoordBox(t, evt);\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.hideCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t)\n",
|
|
" \tt.setAttribute(\"visibility\", \"hidden\");\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t) {\n",
|
|
"\tvar state = t.getAttribute('visibility');\n",
|
|
"\tif ('hidden' != state)\n",
|
|
"\t state = 'hidden';\n",
|
|
"\telse\n",
|
|
"\t state = 'visible';\n",
|
|
"\tt.setAttribute('visibility', state);\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleGrid = function() {\n",
|
|
" if (!gnuplot_svg.SVGDoc.getElementsByClassName) // Old browsers\n",
|
|
"\treturn;\n",
|
|
" var grid = gnuplot_svg.SVGDoc.getElementsByClassName('gridline');\n",
|
|
" for (var i=0; i<grid.length; i++) {\n",
|
|
"\tvar state = grid[i].getAttribute('visibility');\n",
|
|
"\tgrid[i].setAttribute('visibility', (state == 'hidden') ? 'visible' : 'hidden');\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showHypertext = function(evt, mouseovertext)\n",
|
|
"{\n",
|
|
" var lines = mouseovertext.split('\\n');\n",
|
|
"\n",
|
|
" // If text starts with \"image:\" process it as an xlinked bitmap\n",
|
|
" if (lines[0].substring(0,5) == \"image\") {\n",
|
|
"\tvar nameindex = lines[0].indexOf(\":\");\n",
|
|
"\tif (nameindex > 0) {\n",
|
|
"\t gnuplot_svg.showHyperimage(evt, lines[0]);\n",
|
|
"\t lines[0] = lines[0].slice(nameindex+1);\n",
|
|
"\t}\n",
|
|
" }\n",
|
|
"\n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" var anchor_x = loc.x;\n",
|
|
" var anchor_y = loc.y;\n",
|
|
"\t\n",
|
|
" var hypertextbox = document.getElementById(\"hypertextbox\")\n",
|
|
" hypertextbox.setAttributeNS(null,\"x\",anchor_x+10);\n",
|
|
" hypertextbox.setAttributeNS(null,\"y\",anchor_y+4);\n",
|
|
" hypertextbox.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" var hypertext = document.getElementById(\"hypertext\")\n",
|
|
" hypertext.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
" hypertext.setAttributeNS(null,\"y\",anchor_y+18);\n",
|
|
" hypertext.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" var height = 2+16*lines.length;\n",
|
|
" hypertextbox.setAttributeNS(null,\"height\",height);\n",
|
|
" var length = hypertext.getComputedTextLength();\n",
|
|
" hypertextbox.setAttributeNS(null,\"width\",length+8);\n",
|
|
"\n",
|
|
" // bounce off frame bottom\n",
|
|
" if (anchor_y > gnuplot_svg.plot_ybot + 16 - height) {\n",
|
|
"\tanchor_y -= height;\n",
|
|
"\thypertextbox.setAttributeNS(null,\"y\",anchor_y+4);\n",
|
|
"\thypertext.setAttributeNS(null,\"y\",anchor_y+18);\n",
|
|
" }\n",
|
|
"\n",
|
|
" while (null != hypertext.firstChild) {\n",
|
|
" hypertext.removeChild(hypertext.firstChild);\n",
|
|
" }\n",
|
|
"\n",
|
|
" var textNode = document.createTextNode(lines[0]);\n",
|
|
"\n",
|
|
" if (lines.length <= 1) {\n",
|
|
"\thypertext.appendChild(textNode);\n",
|
|
" } else {\n",
|
|
"\txmlns=\"http://www.w3.org/2000/svg\";\n",
|
|
"\tvar tspan_element = document.createElementNS(xmlns, \"tspan\");\n",
|
|
"\ttspan_element.appendChild(textNode);\n",
|
|
"\thypertext.appendChild(tspan_element);\n",
|
|
"\tlength = tspan_element.getComputedTextLength();\n",
|
|
"\tvar ll = length;\n",
|
|
"\n",
|
|
"\tfor (var l=1; l<lines.length; l++) {\n",
|
|
"\t var tspan_element = document.createElementNS(xmlns, \"tspan\");\n",
|
|
"\t tspan_element.setAttributeNS(null,\"dy\", 16);\n",
|
|
"\t textNode = document.createTextNode(lines[l]);\n",
|
|
"\t tspan_element.appendChild(textNode);\n",
|
|
"\t hypertext.appendChild(tspan_element);\n",
|
|
"\n",
|
|
"\t ll = tspan_element.getComputedTextLength();\n",
|
|
"\t if (length < ll) length = ll;\n",
|
|
"\t}\n",
|
|
"\thypertextbox.setAttributeNS(null,\"width\",length+8);\n",
|
|
" }\n",
|
|
"\n",
|
|
" // bounce off right edge\n",
|
|
" if (anchor_x > gnuplot_svg.plot_xmax + 14 - length) {\n",
|
|
"\tanchor_x -= length;\n",
|
|
"\thypertextbox.setAttributeNS(null,\"x\",anchor_x+10);\n",
|
|
"\thypertext.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
" }\n",
|
|
"\n",
|
|
" // left-justify multiline text\n",
|
|
" var tspan_element = hypertext.firstChild;\n",
|
|
" while (tspan_element) {\n",
|
|
"\ttspan_element.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
"\ttspan_element = tspan_element.nextElementSibling;\n",
|
|
" }\n",
|
|
"\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.hideHypertext = function ()\n",
|
|
"{\n",
|
|
" var hypertextbox = document.getElementById(\"hypertextbox\")\n",
|
|
" var hypertext = document.getElementById(\"hypertext\")\n",
|
|
" var hyperimage = document.getElementById(\"hyperimage\")\n",
|
|
" hypertextbox.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
" hypertext.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
" hyperimage.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showHyperimage = function(evt, linktext)\n",
|
|
"{\n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" var anchor_x = loc.x;\n",
|
|
" var anchor_y = loc.y;\n",
|
|
" // Allow for scrollbar position (Firefox, others?)\n",
|
|
" if (typeof evt.pageX != 'undefined') {\n",
|
|
" anchor_x = evt.pageX; anchor_y = evt.pageY; \n",
|
|
" }\n",
|
|
"\n",
|
|
" var hyperimage = document.getElementById(\"hyperimage\")\n",
|
|
" hyperimage.setAttributeNS(null,\"x\",anchor_x);\n",
|
|
" hyperimage.setAttributeNS(null,\"y\",anchor_y);\n",
|
|
" hyperimage.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" // Pick up height and width from \"image(width,height):name\"\n",
|
|
" var width = hyperimage.getAttributeNS(null,\"width\");\n",
|
|
" var height = hyperimage.getAttributeNS(null,\"height\");\n",
|
|
" if (linktext.charAt(5) == \"(\") {\n",
|
|
"\twidth = parseInt(linktext.slice(6));\n",
|
|
"\theight = parseInt(linktext.slice(linktext.indexOf(\",\") + 1));\n",
|
|
"\thyperimage.setAttributeNS(null,\"width\",width);\n",
|
|
"\thyperimage.setAttributeNS(null,\"height\",height);\n",
|
|
"\thyperimage.setAttributeNS(null,\"preserveAspectRatio\",\"none\");\n",
|
|
" }\n",
|
|
"\n",
|
|
" // bounce off frame bottom and right\n",
|
|
" if (anchor_y > gnuplot_svg.plot_ybot + 50 - height)\n",
|
|
"\thyperimage.setAttributeNS(null,\"y\",20 + anchor_y-height);\n",
|
|
" if (anchor_x > gnuplot_svg.plot_xmax + 150 - width)\n",
|
|
"\thyperimage.setAttributeNS(null,\"x\",10 + anchor_x-width);\n",
|
|
"\n",
|
|
" // attach image URL as a link\n",
|
|
" linktext = linktext.slice(linktext.indexOf(\":\") + 1);\n",
|
|
" var xlinkns = \"http://www.w3.org/1999/xlink\";\n",
|
|
" hyperimage.setAttributeNS(xlinkns,\"xlink:href\",linktext);\n",
|
|
"}\n",
|
|
"\n",
|
|
"// Convert from svg panel mouse coordinates to the coordinate\n",
|
|
"// system of the gnuplot figure\n",
|
|
"gnuplot_svg.mouse2plot = function(mousex,mousey) {\n",
|
|
" var plotcoord = new Object;\n",
|
|
" var plotx = mousex - gnuplot_svg.plot_xmin;\n",
|
|
" var ploty = mousey - gnuplot_svg.plot_ybot;\n",
|
|
" var x,y;\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_logaxis_x != 0) {\n",
|
|
"\tx = Math.log(gnuplot_svg.plot_axis_xmax)\n",
|
|
"\t - Math.log(gnuplot_svg.plot_axis_xmin);\n",
|
|
"\tx = x * (plotx / (gnuplot_svg.plot_xmax - gnuplot_svg.plot_xmin))\n",
|
|
"\t + Math.log(gnuplot_svg.plot_axis_xmin);\n",
|
|
"\tx = Math.exp(x);\n",
|
|
" } else {\n",
|
|
"\tx = gnuplot_svg.plot_axis_xmin + (plotx / (gnuplot_svg.plot_xmax-gnuplot_svg.plot_xmin)) * (gnuplot_svg.plot_axis_xmax - gnuplot_svg.plot_axis_xmin);\n",
|
|
" }\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_logaxis_y != 0) {\n",
|
|
"\ty = Math.log(gnuplot_svg.plot_axis_ymax)\n",
|
|
"\t - Math.log(gnuplot_svg.plot_axis_ymin);\n",
|
|
"\ty = y * (ploty / (gnuplot_svg.plot_ytop - gnuplot_svg.plot_ybot))\n",
|
|
"\t + Math.log(gnuplot_svg.plot_axis_ymin);\n",
|
|
"\ty = Math.exp(y);\n",
|
|
" } else {\n",
|
|
"\ty = gnuplot_svg.plot_axis_ymin + (ploty / (gnuplot_svg.plot_ytop-gnuplot_svg.plot_ybot)) * (gnuplot_svg.plot_axis_ymax - gnuplot_svg.plot_axis_ymin);\n",
|
|
" }\n",
|
|
"\n",
|
|
" plotcoord.x = x;\n",
|
|
" plotcoord.y = y;\n",
|
|
" return plotcoord;\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.convert_to_polar = function (x,y)\n",
|
|
"{\n",
|
|
" polar = new Object;\n",
|
|
" var phi, r;\n",
|
|
" phi = Math.atan2(y,x);\n",
|
|
" if (gnuplot_svg.plot_logaxis_r) \n",
|
|
" r = Math.exp( (x/Math.cos(phi) + Math.log(gnuplot_svg.plot_axis_rmin)/Math.LN10) * Math.LN10);\n",
|
|
" else if (gnuplot_svg.plot_axis_rmin > gnuplot_svg.plot_axis_rmax)\n",
|
|
" r = gnuplot_svg.plot_axis_rmin - x/Math.cos(phi);\n",
|
|
" else\n",
|
|
" r = gnuplot_svg.plot_axis_rmin + x/Math.cos(phi);\n",
|
|
" phi = phi * (180./Math.PI);\n",
|
|
" if (gnuplot_svg.polar_sense < 0)\n",
|
|
"\tphi = -phi;\n",
|
|
" if (gnuplot_svg.polar_theta0 != undefined)\n",
|
|
"\tphi = phi + gnuplot_svg.polar_theta0;\n",
|
|
" if (phi > 180.)\n",
|
|
"\tphi = phi - 360.;\n",
|
|
" polar.r = r;\n",
|
|
" polar.ang = phi;\n",
|
|
" return polar;\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.convert_to_DMS = function (x)\n",
|
|
"{\n",
|
|
" var dms = {d:0, m:0, s:0};\n",
|
|
" var deg = Math.abs(x);\n",
|
|
" dms.d = Math.floor(deg);\n",
|
|
" dms.m = Math.floor((deg - dms.d) * 60.);\n",
|
|
" dms.s = Math.floor((deg - dms.d) * 3600. - dms.m * 60.);\n",
|
|
" fmt = ((x<0)?\"-\":\" \")\n",
|
|
" + dms.d.toFixed(0) + \"°\"\n",
|
|
"\t+ dms.m.toFixed(0) + \"\\\"\"\n",
|
|
"\t+ dms.s.toFixed(0) + \"'\";\n",
|
|
" return fmt;\n",
|
|
"}\n",
|
|
"]]>\n",
|
|
"</script>\n",
|
|
"\n",
|
|
"<!-- Tie mousing to entire bounding box of the plot -->\n",
|
|
"<rect x=\"0\" y=\"0\" width=\"800\" height=\"400\" fill=\"#ffffff\" stroke=\"black\" stroke-width=\"1\"\n",
|
|
"onclick=\"gnuplot_svg.toggleCoordBox(evt)\" onmousemove=\"gnuplot_svg.moveCoordBox(evt)\"/>\n",
|
|
"\n",
|
|
"<!-- Also track mouse when it is on a plot element -->\n",
|
|
"<g id=\"gnuplot_canvas\" onclick=\"gnuplot_svg.toggleCoordBox(evt)\" onmousemove=\"gnuplot_svg.moveCoordBox(evt)\">\n",
|
|
"\n",
|
|
"<defs>\n",
|
|
"\n",
|
|
"\t<circle id='gpDot' r='0.5' stroke-width='0.5' stroke='currentColor'/>\n",
|
|
"\t<path id='gpPt0' stroke-width='0.222' stroke='currentColor' d='M-1,0 h2 M0,-1 v2'/>\n",
|
|
"\t<path id='gpPt1' stroke-width='0.222' stroke='currentColor' d='M-1,-1 L1,1 M1,-1 L-1,1'/>\n",
|
|
"\t<path id='gpPt2' stroke-width='0.222' stroke='currentColor' d='M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1'/>\n",
|
|
"\t<rect id='gpPt3' stroke-width='0.222' stroke='currentColor' x='-1' y='-1' width='2' height='2'/>\n",
|
|
"\t<rect id='gpPt4' stroke-width='0.222' stroke='currentColor' fill='currentColor' x='-1' y='-1' width='2' height='2'/>\n",
|
|
"\t<circle id='gpPt5' stroke-width='0.222' stroke='currentColor' cx='0' cy='0' r='1'/>\n",
|
|
"\t<use xlink:href='#gpPt5' id='gpPt6' fill='currentColor' stroke='none'/>\n",
|
|
"\t<path id='gpPt7' stroke-width='0.222' stroke='currentColor' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'/>\n",
|
|
"\t<use xlink:href='#gpPt7' id='gpPt8' fill='currentColor' stroke='none'/>\n",
|
|
"\t<use xlink:href='#gpPt7' id='gpPt9' stroke='currentColor' transform='rotate(180)'/>\n",
|
|
"\t<use xlink:href='#gpPt9' id='gpPt10' fill='currentColor' stroke='none'/>\n",
|
|
"\t<use xlink:href='#gpPt3' id='gpPt11' stroke='currentColor' transform='rotate(45)'/>\n",
|
|
"\t<use xlink:href='#gpPt11' id='gpPt12' fill='currentColor' stroke='none'/>\n",
|
|
"\t<path id='gpPt13' stroke-width='0.222' stroke='currentColor' d='M0,1.330 L1.265,0.411 L0.782,-1.067 L-0.782,-1.076 L-1.265,0.411 z'/>\n",
|
|
"\t<use xlink:href='#gpPt13' id='gpPt14' fill='currentColor' stroke='none'/>\n",
|
|
"\t<filter id='textbox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>\n",
|
|
"\t <feFlood flood-color='white' flood-opacity='1' result='bgnd'/>\n",
|
|
"\t <feComposite in='SourceGraphic' in2='bgnd' operator='atop'/>\n",
|
|
"\t</filter>\n",
|
|
"\t<filter id='greybox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>\n",
|
|
"\t <feFlood flood-color='lightgrey' flood-opacity='1' result='grey'/>\n",
|
|
"\t <feComposite in='SourceGraphic' in2='grey' operator='atop'/>\n",
|
|
"\t</filter>\n",
|
|
"</defs>\n",
|
|
"<g fill=\"none\" color=\"white\" stroke=\"black\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,364.0 L62.9,364.0 M775.0,364.0 L766.0,364.0 '/>\t<g transform=\"translate(45.6,367.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-1.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,306.3 L62.9,306.3 M775.0,306.3 L766.0,306.3 '/>\t<g transform=\"translate(45.6,310.2)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,248.7 L62.9,248.7 M775.0,248.7 L766.0,248.7 '/>\t<g transform=\"translate(45.6,252.6)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-0.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,191.0 L62.9,191.0 M775.0,191.0 L766.0,191.0 '/>\t<g transform=\"translate(45.6,194.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,133.4 L62.9,133.4 M775.0,133.4 L766.0,133.4 '/>\t<g transform=\"translate(45.6,137.3)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,75.7 L62.9,75.7 M775.0,75.7 L766.0,75.7 '/>\t<g transform=\"translate(45.6,79.6)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L62.9,18.1 M775.0,18.1 L766.0,18.1 '/>\t<g transform=\"translate(45.6,22.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,364.0 L53.9,355.0 M53.9,18.1 L53.9,27.1 '/>\t<g transform=\"translate(53.9,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M134.0,364.0 L134.0,355.0 M134.0,18.1 L134.0,27.1 '/>\t<g transform=\"translate(134.0,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 2</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M214.1,364.0 L214.1,355.0 M214.1,18.1 L214.1,27.1 '/>\t<g transform=\"translate(214.1,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 3</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M294.3,364.0 L294.3,355.0 M294.3,18.1 L294.3,27.1 '/>\t<g transform=\"translate(294.3,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 4</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M374.4,364.0 L374.4,355.0 M374.4,18.1 L374.4,27.1 '/>\t<g transform=\"translate(374.4,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M454.5,364.0 L454.5,355.0 M454.5,18.1 L454.5,27.1 '/>\t<g transform=\"translate(454.5,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 6</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M534.6,364.0 L534.6,355.0 M534.6,18.1 L534.6,27.1 '/>\t<g transform=\"translate(534.6,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 7</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M614.8,364.0 L614.8,355.0 M614.8,18.1 L614.8,27.1 '/>\t<g transform=\"translate(614.8,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 8</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M694.9,364.0 L694.9,355.0 M694.9,18.1 L694.9,27.1 '/>\t<g transform=\"translate(694.9,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 9</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M775.0,364.0 L775.0,355.0 M775.0,18.1 L775.0,27.1 '/>\t<g transform=\"translate(775.0,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 10</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L53.9,364.0 L775.0,364.0 L775.0,18.1 L53.9,18.1 Z '/></g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"\t<g id=\"gnuplot_plot_1\" ><title>sin</title>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_1_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_1')\">\n",
|
|
"\t<g transform=\"translate(707.9,40.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >sin</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb(148, 0, 211)' d='M716.2,36.1 L758.4,36.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb(148, 0, 211)' d='M53.9,94.0 L61.9,88.3 L69.9,83.6 L77.9,80.0 L85.9,77.4 L94.0,76.0 L102.0,75.8 L110.0,76.7\n",
|
|
"\t\tL118.0,78.8 L126.0,81.9 L134.0,86.2 L142.0,91.5 L150.0,97.8 L158.1,105.1 L166.1,113.2 L174.1,122.0\n",
|
|
"\t\tL182.1,131.6 L190.1,141.8 L198.1,152.4 L206.1,163.5 L214.1,174.8 L222.2,186.3 L230.2,197.8 L238.2,209.2\n",
|
|
"\t\tL246.2,220.5 L254.2,231.5 L262.2,242.1 L270.2,252.1 L278.2,261.6 L286.3,270.3 L294.3,278.3 L302.3,285.4\n",
|
|
"\t\tL310.3,291.5 L318.3,296.7 L326.3,300.8 L334.3,303.8 L342.3,305.6 L350.4,306.3 L358.4,305.9 L366.4,304.3\n",
|
|
"\t\tL374.4,301.6 L382.4,297.8 L390.4,292.9 L398.4,287.0 L406.4,280.1 L414.5,272.4 L422.5,263.8 L430.5,254.5\n",
|
|
"\t\tL438.5,244.6 L446.5,234.2 L454.5,223.3 L462.5,212.1 L470.5,200.6 L478.5,189.1 L486.6,177.6 L494.6,166.2\n",
|
|
"\t\tL502.6,155.1 L510.6,144.4 L518.6,134.1 L526.6,124.4 L534.6,115.3 L542.6,107.0 L550.7,99.5 L558.7,93.0\n",
|
|
"\t\tL566.7,87.4 L574.7,82.9 L582.7,79.4 L590.7,77.1 L598.7,75.9 L606.7,75.9 L614.8,77.0 L622.8,79.2\n",
|
|
"\t\tL630.8,82.6 L638.8,87.0 L646.8,92.5 L654.8,99.0 L662.8,106.4 L670.8,114.6 L678.9,123.6 L686.9,133.3\n",
|
|
"\t\tL694.9,143.5 L702.9,154.3 L710.9,165.4 L718.9,176.7 L726.9,188.2 L734.9,199.7 L743.0,211.1 L751.0,222.4\n",
|
|
"\t\tL759.0,233.3 L767.0,243.8 L775.0,253.8 '/></g>\n",
|
|
"\t</g>\n",
|
|
"\t<g id=\"gnuplot_plot_2\" ><title>cos</title>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_2_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_2')\">\n",
|
|
"\t<g transform=\"translate(707.9,58.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >cos</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb( 0, 158, 115)' d='M716.2,54.1 L758.4,54.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb( 0, 158, 115)' d='M53.9,128.8 L61.9,138.8 L69.9,149.3 L77.9,160.2 L85.9,171.5 L94.0,182.9 L102.0,194.4 L110.0,205.9\n",
|
|
"\t\tL118.0,217.2 L126.0,228.3 L134.0,239.0 L142.0,249.3 L150.0,258.9 L158.1,267.9 L166.1,276.1 L174.1,283.4\n",
|
|
"\t\tL182.1,289.8 L190.1,295.3 L198.1,299.7 L206.1,303.0 L214.1,305.2 L222.2,306.3 L230.2,306.2 L238.2,304.9\n",
|
|
"\t\tL246.2,302.5 L254.2,299.0 L262.2,294.4 L270.2,288.8 L278.2,282.2 L286.3,274.7 L294.3,266.4 L302.3,257.3\n",
|
|
"\t\tL310.3,247.6 L318.3,237.3 L326.3,226.5 L334.3,215.4 L342.3,204.0 L350.4,192.5 L358.4,181.0 L366.4,169.5\n",
|
|
"\t\tL374.4,158.3 L382.4,147.5 L390.4,137.0 L398.4,127.1 L406.4,117.9 L414.5,109.3 L422.5,101.6 L430.5,94.8\n",
|
|
"\t\tL438.5,88.9 L446.5,84.1 L454.5,80.3 L462.5,77.7 L470.5,76.1 L478.5,75.8 L486.6,76.5 L494.6,78.4\n",
|
|
"\t\tL502.6,81.5 L510.6,85.6 L518.6,90.8 L526.6,97.0 L534.6,104.1 L542.6,112.1 L550.7,120.9 L558.7,130.4\n",
|
|
"\t\tL566.7,140.5 L574.7,151.1 L582.7,162.1 L590.7,173.4 L598.7,184.8 L606.7,196.4 L614.8,207.8 L622.8,219.1\n",
|
|
"\t\tL630.8,230.2 L638.8,240.8 L646.8,250.9 L654.8,260.5 L662.8,269.3 L670.8,277.4 L678.9,284.6 L686.9,290.8\n",
|
|
"\t\tL694.9,296.1 L702.9,300.3 L710.9,303.4 L718.9,305.5 L726.9,306.3 L734.9,306.0 L743.0,304.6 L751.0,302.0\n",
|
|
"\t\tL759.0,298.3 L767.0,293.6 L775.0,287.8 '/></g>\n",
|
|
"\t</g>\n",
|
|
"\t<g id=\"gnuplot_plot_3\" ><title>sin+cos</title>\n",
|
|
"<g fill=\"none\" color=\"white\" stroke=\"rgb( 0, 158, 115)\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_3_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_3')\">\n",
|
|
"\t<g transform=\"translate(707.9,76.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >sin+cos</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb( 86, 180, 233)' d='M716.2,72.1 L758.4,72.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb( 86, 180, 233)' d='M53.9,31.7 L61.9,36.0 L69.9,41.8 L77.9,49.1 L85.9,57.8 L94.0,67.9 L102.0,79.2 L110.0,91.6\n",
|
|
"\t\tL118.0,105.0 L126.0,119.2 L134.0,134.2 L142.0,149.7 L150.0,165.7 L158.1,181.9 L166.1,198.2 L174.1,214.4\n",
|
|
"\t\tL182.1,230.4 L190.1,246.0 L198.1,261.1 L206.1,275.4 L214.1,288.9 L222.2,301.5 L230.2,312.9 L238.2,323.1\n",
|
|
"\t\tL246.2,332.0 L254.2,339.5 L262.2,345.5 L270.2,349.9 L278.2,352.8 L286.3,354.0 L294.3,353.7 L302.3,351.7\n",
|
|
"\t\tL310.3,348.1 L318.3,342.9 L326.3,336.2 L334.3,328.1 L342.3,318.6 L350.4,307.8 L358.4,295.8 L366.4,282.8\n",
|
|
"\t\tL374.4,268.9 L382.4,254.2 L390.4,238.9 L398.4,223.1 L406.4,207.0 L414.5,190.7 L422.5,174.4 L430.5,158.3\n",
|
|
"\t\tL438.5,142.5 L446.5,127.2 L454.5,112.6 L462.5,98.7 L470.5,85.7 L478.5,73.8 L486.6,63.1 L494.6,53.6\n",
|
|
"\t\tL502.6,45.6 L510.6,38.9 L518.6,33.8 L526.6,30.3 L534.6,28.4 L542.6,28.1 L550.7,29.4 L558.7,32.3\n",
|
|
"\t\tL566.7,36.9 L574.7,42.9 L582.7,50.5 L590.7,59.4 L598.7,69.7 L606.7,81.2 L614.8,93.8 L622.8,107.3\n",
|
|
"\t\tL630.8,121.7 L638.8,136.8 L646.8,152.4 L654.8,168.4 L662.8,184.6 L670.8,200.9 L678.9,217.1 L686.9,233.1\n",
|
|
"\t\tL694.9,248.6 L702.9,263.5 L710.9,277.8 L718.9,291.1 L726.9,303.5 L734.9,314.7 L743.0,324.7 L751.0,333.3\n",
|
|
"\t\tL759.0,340.6 L767.0,346.3 L775.0,350.5 '/></g>\n",
|
|
"\t</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"black\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L53.9,364.0 L775.0,364.0 L775.0,18.1 L53.9,18.1 Z '/></g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"\n",
|
|
"<script type=\"text/javascript\"><![CDATA[\n",
|
|
"// plot boundaries and axis scaling information for mousing \n",
|
|
"gnuplot_svg.plot_term_xmax = 800;\n",
|
|
"gnuplot_svg.plot_term_ymax = 400;\n",
|
|
"gnuplot_svg.plot_xmin = 53.9;\n",
|
|
"gnuplot_svg.plot_xmax = 775.0;\n",
|
|
"gnuplot_svg.plot_ybot = 364.0;\n",
|
|
"gnuplot_svg.plot_ytop = 18.1;\n",
|
|
"gnuplot_svg.plot_width = 721.1;\n",
|
|
"gnuplot_svg.plot_height = 345.9;\n",
|
|
"gnuplot_svg.plot_axis_xmin = 1;\n",
|
|
"gnuplot_svg.plot_axis_xmax = 10;\n",
|
|
"gnuplot_svg.plot_axis_ymin = -1.5;\n",
|
|
"gnuplot_svg.plot_axis_ymax = 1.5;\n",
|
|
"gnuplot_svg.polar_mode = false;\n",
|
|
"gnuplot_svg.plot_axis_x2min = \"none\"\n",
|
|
"gnuplot_svg.plot_axis_y2min = \"none\"\n",
|
|
"gnuplot_svg.plot_logaxis_x = 0;\n",
|
|
"gnuplot_svg.plot_logaxis_y = 0;\n",
|
|
"gnuplot_svg.plot_timeaxis_x = \"\";\n",
|
|
"gnuplot_svg.plot_timeaxis_y = \"\";\n",
|
|
"]]>\n",
|
|
"</script>\n",
|
|
"</g>\n",
|
|
"\n",
|
|
" <text id=\"coord_text\" text-anchor=\"start\" pointer-events=\"none\"\n",
|
|
" font-size=\"12\" font-family=\"Arial\"\n",
|
|
" visibility=\"hidden\"> </text>\n",
|
|
"\n",
|
|
" <rect id=\"hypertextbox\" class=\"hypertextbox\" pointer-events=\"none\"\n",
|
|
" fill=\"white\" stroke=\"black\" opacity=\"0.8\"\n",
|
|
" height=\"16\" visibility=\"hidden\" />\n",
|
|
"\n",
|
|
" <text id=\"hypertext\" class=\"hypertext\" pointer-events=\"none\"\n",
|
|
" font-size=\"12\" font-family=\"Arial\"\n",
|
|
" visibility=\"hidden\"> </text>\n",
|
|
"\n",
|
|
" <image id=\"hyperimage\" class=\"hyperimage\" pointer-events=\"none\"\n",
|
|
" fill=\"white\" stroke=\"black\" opacity=\"0.8\"\n",
|
|
" height=\"200\" width=\"300\" visibility=\"hidden\" />\n",
|
|
"</svg>\n",
|
|
"\n"
|
|
],
|
|
"text/plain": []
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"display(ans)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Unlike the previous case, note that the updated a plot now appears in a **separate** image.\n",
|
|
"\n",
|
|
"The above code produced two inline images. Now invoke the same code within the `complex_function()` function:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"complex_function()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Unlike the previous case nothing appeared here since we need to explicitly invoke `display()` on the proper session:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png": "",
|
|
"image/svg+xml": [],
|
|
"text/html": [
|
|
"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
|
|
"<svg onload=\"if (typeof(gnuplot_svg)!='undefined') gnuplot_svg.Init(evt)\" \n",
|
|
" width=\"800\" height=\"400\"\n",
|
|
" viewBox=\"0 0 800 400\"\n",
|
|
" xmlns=\"http://www.w3.org/2000/svg\"\n",
|
|
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
|
|
">\n",
|
|
"\n",
|
|
"<title>Gnuplot</title>\n",
|
|
"<desc>Produced by GNUPLOT 5.2 patchlevel 8 </desc>\n",
|
|
"\n",
|
|
"<script type=\"text/javascript\" > <![CDATA[\n",
|
|
"// Javascript routines for interaction with SVG documents produced by \n",
|
|
"// gnuplot's SVG terminal driver.\n",
|
|
"\n",
|
|
"// Find your root SVG element\n",
|
|
"var svg = document.querySelector('svg');\n",
|
|
"\n",
|
|
"// Create an SVGPoint for future math\n",
|
|
"var pt = svg.createSVGPoint();\n",
|
|
"\n",
|
|
"// Get point in global SVG space\n",
|
|
"function cursorPoint(evt){\n",
|
|
" pt.x = evt.clientX; pt.y = evt.clientY;\n",
|
|
" return pt.matrixTransform(svg.getScreenCTM().inverse());\n",
|
|
"}\n",
|
|
"\n",
|
|
"var gnuplot_svg = { };\n",
|
|
"\n",
|
|
"gnuplot_svg.version = \"17 February 2017\";\n",
|
|
"\n",
|
|
"gnuplot_svg.SVGDoc = null;\n",
|
|
"gnuplot_svg.SVGRoot = null;\n",
|
|
"\n",
|
|
"gnuplot_svg.Init = function(e)\n",
|
|
"{\n",
|
|
" gnuplot_svg.SVGDoc = e.target.ownerDocument;\n",
|
|
" gnuplot_svg.SVGRoot = gnuplot_svg.SVGDoc.documentElement;\n",
|
|
" gnuplot_svg.axisdate = new Date();\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleVisibility = function(evt, targetId)\n",
|
|
"{\n",
|
|
" var newTarget = evt.target;\n",
|
|
" if (targetId)\n",
|
|
" newTarget = gnuplot_svg.SVGDoc.getElementById(targetId);\n",
|
|
"\n",
|
|
" var newValue = newTarget.getAttributeNS(null, 'visibility')\n",
|
|
"\n",
|
|
" if ('hidden' != newValue)\n",
|
|
" newValue = 'hidden';\n",
|
|
" else\n",
|
|
" newValue = 'visible';\n",
|
|
"\n",
|
|
" newTarget.setAttributeNS(null, 'visibility', newValue);\n",
|
|
"\n",
|
|
" if (targetId) {\n",
|
|
" newTarget = gnuplot_svg.SVGDoc.getElementById(targetId.concat(\"_keyentry\"));\n",
|
|
" if (newTarget)\n",
|
|
" newTarget.setAttributeNS(null, 'style',\n",
|
|
"\t\tnewValue == 'hidden' ? 'filter:url(#greybox)' : 'none');\n",
|
|
" }\n",
|
|
"\n",
|
|
" evt.preventDefault();\n",
|
|
" evt.stopPropagation();\n",
|
|
"}\n",
|
|
"\n",
|
|
"// Mouse tracking echos coordinates to a floating text box\n",
|
|
"\n",
|
|
"gnuplot_svg.getText = function() {\n",
|
|
"\treturn(document.getElementById(\"coord_text\"));\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.updateCoordBox = function(t, evt) {\n",
|
|
" /* \n",
|
|
" * Apply screen CTM transformation to the evt screenX and screenY to get \n",
|
|
" * coordinates in SVG coordinate space. Use scaling parameters stored in\n",
|
|
" * the plot document by gnuplot to convert further into plot coordinates.\n",
|
|
" * Then position the floating text box using the SVG coordinates.\n",
|
|
" */\n",
|
|
" var m = document.documentElement.getScreenCTM();\n",
|
|
" var p = document.documentElement.createSVGPoint(); \n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" p.x = loc.x;\n",
|
|
" p.y = loc.y;\n",
|
|
" var label_x, label_y;\n",
|
|
"\n",
|
|
" // Allow for scrollbar position (Firefox, others?)\n",
|
|
" if (typeof evt.pageX != 'undefined') {\n",
|
|
" p.x = evt.pageX; p.y = evt.pageY; \n",
|
|
" }\n",
|
|
" t.setAttribute(\"x\", p.x);\n",
|
|
" t.setAttribute(\"y\", p.y);\n",
|
|
" \n",
|
|
" var plotcoord = gnuplot_svg.mouse2plot(p.x,p.y);\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_timeaxis_x == \"DMS\" || gnuplot_svg.plot_timeaxis_y == \"DMS\") {\n",
|
|
"\tif (gnuplot_svg.plot_timeaxis_x == \"DMS\")\n",
|
|
"\t label_x = gnuplot_svg.convert_to_DMS(x);\n",
|
|
"\telse\n",
|
|
"\t label_x = plotcoord.x.toFixed(2);\n",
|
|
"\tif (gnuplot_svg.plot_timeaxis_y == \"DMS\")\n",
|
|
"\t label_y = gnuplot_svg.convert_to_DMS(y);\n",
|
|
"\telse\n",
|
|
"\t label_y = plotcoord.y.toFixed(2);\n",
|
|
"\n",
|
|
" } else if (gnuplot_svg.polar_mode) {\n",
|
|
"\tpolar = gnuplot_svg.convert_to_polar(plotcoord.x,plotcoord.y);\n",
|
|
"\tlabel_x = \"ang= \" + polar.ang.toPrecision(4);\n",
|
|
"\tlabel_y = \"R= \" + polar.r.toPrecision(4);\n",
|
|
"\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"Date\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tvar year = gnuplot_svg.axisdate.getUTCFullYear();\n",
|
|
"\tvar month = gnuplot_svg.axisdate.getUTCMonth();\n",
|
|
"\tvar date = gnuplot_svg.axisdate.getUTCDate();\n",
|
|
"\tlabel_x = (\" \" + date).slice (-2) + \"/\"\n",
|
|
"\t\t+ (\"0\" + (month+1)).slice (-2) + \"/\"\n",
|
|
"\t\t+ year;\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"Time\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tvar hour = gnuplot_svg.axisdate.getUTCHours();\n",
|
|
"\tvar minute = gnuplot_svg.axisdate.getUTCMinutes();\n",
|
|
"\tvar second = gnuplot_svg.axisdate.getUTCSeconds();\n",
|
|
"\tlabel_x = (\"0\" + hour).slice (-2) + \":\" \n",
|
|
"\t\t+ (\"0\" + minute).slice (-2) + \":\"\n",
|
|
"\t\t+ (\"0\" + second).slice (-2);\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else if (gnuplot_svg.plot_timeaxis_x == \"DateTime\") {\n",
|
|
"\tgnuplot_svg.axisdate.setTime(1000. * plotcoord.x);\n",
|
|
"\tlabel_x = gnuplot_svg.axisdate.toUTCString();\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" } else {\n",
|
|
"\tlabel_x = plotcoord.x.toFixed(2);\n",
|
|
"\tlabel_y = plotcoord.y.toFixed(2);\n",
|
|
" }\n",
|
|
"\n",
|
|
" while (null != t.firstChild) {\n",
|
|
" \tt.removeChild(t.firstChild);\n",
|
|
" }\n",
|
|
" var textNode = document.createTextNode(\". \"+label_x+\" \"+label_y);\n",
|
|
" t.appendChild(textNode);\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t) {\n",
|
|
" \tt.setAttribute(\"visibility\", \"visible\");\n",
|
|
" \tgnuplot_svg.updateCoordBox(t, evt);\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.moveCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t)\n",
|
|
" \tgnuplot_svg.updateCoordBox(t, evt);\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.hideCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t)\n",
|
|
" \tt.setAttribute(\"visibility\", \"hidden\");\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleCoordBox = function(evt) {\n",
|
|
" var t = gnuplot_svg.getText();\n",
|
|
" if (null != t) {\n",
|
|
"\tvar state = t.getAttribute('visibility');\n",
|
|
"\tif ('hidden' != state)\n",
|
|
"\t state = 'hidden';\n",
|
|
"\telse\n",
|
|
"\t state = 'visible';\n",
|
|
"\tt.setAttribute('visibility', state);\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.toggleGrid = function() {\n",
|
|
" if (!gnuplot_svg.SVGDoc.getElementsByClassName) // Old browsers\n",
|
|
"\treturn;\n",
|
|
" var grid = gnuplot_svg.SVGDoc.getElementsByClassName('gridline');\n",
|
|
" for (var i=0; i<grid.length; i++) {\n",
|
|
"\tvar state = grid[i].getAttribute('visibility');\n",
|
|
"\tgrid[i].setAttribute('visibility', (state == 'hidden') ? 'visible' : 'hidden');\n",
|
|
" }\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showHypertext = function(evt, mouseovertext)\n",
|
|
"{\n",
|
|
" var lines = mouseovertext.split('\\n');\n",
|
|
"\n",
|
|
" // If text starts with \"image:\" process it as an xlinked bitmap\n",
|
|
" if (lines[0].substring(0,5) == \"image\") {\n",
|
|
"\tvar nameindex = lines[0].indexOf(\":\");\n",
|
|
"\tif (nameindex > 0) {\n",
|
|
"\t gnuplot_svg.showHyperimage(evt, lines[0]);\n",
|
|
"\t lines[0] = lines[0].slice(nameindex+1);\n",
|
|
"\t}\n",
|
|
" }\n",
|
|
"\n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" var anchor_x = loc.x;\n",
|
|
" var anchor_y = loc.y;\n",
|
|
"\t\n",
|
|
" var hypertextbox = document.getElementById(\"hypertextbox\")\n",
|
|
" hypertextbox.setAttributeNS(null,\"x\",anchor_x+10);\n",
|
|
" hypertextbox.setAttributeNS(null,\"y\",anchor_y+4);\n",
|
|
" hypertextbox.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" var hypertext = document.getElementById(\"hypertext\")\n",
|
|
" hypertext.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
" hypertext.setAttributeNS(null,\"y\",anchor_y+18);\n",
|
|
" hypertext.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" var height = 2+16*lines.length;\n",
|
|
" hypertextbox.setAttributeNS(null,\"height\",height);\n",
|
|
" var length = hypertext.getComputedTextLength();\n",
|
|
" hypertextbox.setAttributeNS(null,\"width\",length+8);\n",
|
|
"\n",
|
|
" // bounce off frame bottom\n",
|
|
" if (anchor_y > gnuplot_svg.plot_ybot + 16 - height) {\n",
|
|
"\tanchor_y -= height;\n",
|
|
"\thypertextbox.setAttributeNS(null,\"y\",anchor_y+4);\n",
|
|
"\thypertext.setAttributeNS(null,\"y\",anchor_y+18);\n",
|
|
" }\n",
|
|
"\n",
|
|
" while (null != hypertext.firstChild) {\n",
|
|
" hypertext.removeChild(hypertext.firstChild);\n",
|
|
" }\n",
|
|
"\n",
|
|
" var textNode = document.createTextNode(lines[0]);\n",
|
|
"\n",
|
|
" if (lines.length <= 1) {\n",
|
|
"\thypertext.appendChild(textNode);\n",
|
|
" } else {\n",
|
|
"\txmlns=\"http://www.w3.org/2000/svg\";\n",
|
|
"\tvar tspan_element = document.createElementNS(xmlns, \"tspan\");\n",
|
|
"\ttspan_element.appendChild(textNode);\n",
|
|
"\thypertext.appendChild(tspan_element);\n",
|
|
"\tlength = tspan_element.getComputedTextLength();\n",
|
|
"\tvar ll = length;\n",
|
|
"\n",
|
|
"\tfor (var l=1; l<lines.length; l++) {\n",
|
|
"\t var tspan_element = document.createElementNS(xmlns, \"tspan\");\n",
|
|
"\t tspan_element.setAttributeNS(null,\"dy\", 16);\n",
|
|
"\t textNode = document.createTextNode(lines[l]);\n",
|
|
"\t tspan_element.appendChild(textNode);\n",
|
|
"\t hypertext.appendChild(tspan_element);\n",
|
|
"\n",
|
|
"\t ll = tspan_element.getComputedTextLength();\n",
|
|
"\t if (length < ll) length = ll;\n",
|
|
"\t}\n",
|
|
"\thypertextbox.setAttributeNS(null,\"width\",length+8);\n",
|
|
" }\n",
|
|
"\n",
|
|
" // bounce off right edge\n",
|
|
" if (anchor_x > gnuplot_svg.plot_xmax + 14 - length) {\n",
|
|
"\tanchor_x -= length;\n",
|
|
"\thypertextbox.setAttributeNS(null,\"x\",anchor_x+10);\n",
|
|
"\thypertext.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
" }\n",
|
|
"\n",
|
|
" // left-justify multiline text\n",
|
|
" var tspan_element = hypertext.firstChild;\n",
|
|
" while (tspan_element) {\n",
|
|
"\ttspan_element.setAttributeNS(null,\"x\",anchor_x+14);\n",
|
|
"\ttspan_element = tspan_element.nextElementSibling;\n",
|
|
" }\n",
|
|
"\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.hideHypertext = function ()\n",
|
|
"{\n",
|
|
" var hypertextbox = document.getElementById(\"hypertextbox\")\n",
|
|
" var hypertext = document.getElementById(\"hypertext\")\n",
|
|
" var hyperimage = document.getElementById(\"hyperimage\")\n",
|
|
" hypertextbox.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
" hypertext.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
" hyperimage.setAttributeNS(null,\"visibility\",\"hidden\");\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.showHyperimage = function(evt, linktext)\n",
|
|
"{\n",
|
|
" var loc = cursorPoint(evt);\n",
|
|
" var anchor_x = loc.x;\n",
|
|
" var anchor_y = loc.y;\n",
|
|
" // Allow for scrollbar position (Firefox, others?)\n",
|
|
" if (typeof evt.pageX != 'undefined') {\n",
|
|
" anchor_x = evt.pageX; anchor_y = evt.pageY; \n",
|
|
" }\n",
|
|
"\n",
|
|
" var hyperimage = document.getElementById(\"hyperimage\")\n",
|
|
" hyperimage.setAttributeNS(null,\"x\",anchor_x);\n",
|
|
" hyperimage.setAttributeNS(null,\"y\",anchor_y);\n",
|
|
" hyperimage.setAttributeNS(null,\"visibility\",\"visible\");\n",
|
|
"\n",
|
|
" // Pick up height and width from \"image(width,height):name\"\n",
|
|
" var width = hyperimage.getAttributeNS(null,\"width\");\n",
|
|
" var height = hyperimage.getAttributeNS(null,\"height\");\n",
|
|
" if (linktext.charAt(5) == \"(\") {\n",
|
|
"\twidth = parseInt(linktext.slice(6));\n",
|
|
"\theight = parseInt(linktext.slice(linktext.indexOf(\",\") + 1));\n",
|
|
"\thyperimage.setAttributeNS(null,\"width\",width);\n",
|
|
"\thyperimage.setAttributeNS(null,\"height\",height);\n",
|
|
"\thyperimage.setAttributeNS(null,\"preserveAspectRatio\",\"none\");\n",
|
|
" }\n",
|
|
"\n",
|
|
" // bounce off frame bottom and right\n",
|
|
" if (anchor_y > gnuplot_svg.plot_ybot + 50 - height)\n",
|
|
"\thyperimage.setAttributeNS(null,\"y\",20 + anchor_y-height);\n",
|
|
" if (anchor_x > gnuplot_svg.plot_xmax + 150 - width)\n",
|
|
"\thyperimage.setAttributeNS(null,\"x\",10 + anchor_x-width);\n",
|
|
"\n",
|
|
" // attach image URL as a link\n",
|
|
" linktext = linktext.slice(linktext.indexOf(\":\") + 1);\n",
|
|
" var xlinkns = \"http://www.w3.org/1999/xlink\";\n",
|
|
" hyperimage.setAttributeNS(xlinkns,\"xlink:href\",linktext);\n",
|
|
"}\n",
|
|
"\n",
|
|
"// Convert from svg panel mouse coordinates to the coordinate\n",
|
|
"// system of the gnuplot figure\n",
|
|
"gnuplot_svg.mouse2plot = function(mousex,mousey) {\n",
|
|
" var plotcoord = new Object;\n",
|
|
" var plotx = mousex - gnuplot_svg.plot_xmin;\n",
|
|
" var ploty = mousey - gnuplot_svg.plot_ybot;\n",
|
|
" var x,y;\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_logaxis_x != 0) {\n",
|
|
"\tx = Math.log(gnuplot_svg.plot_axis_xmax)\n",
|
|
"\t - Math.log(gnuplot_svg.plot_axis_xmin);\n",
|
|
"\tx = x * (plotx / (gnuplot_svg.plot_xmax - gnuplot_svg.plot_xmin))\n",
|
|
"\t + Math.log(gnuplot_svg.plot_axis_xmin);\n",
|
|
"\tx = Math.exp(x);\n",
|
|
" } else {\n",
|
|
"\tx = gnuplot_svg.plot_axis_xmin + (plotx / (gnuplot_svg.plot_xmax-gnuplot_svg.plot_xmin)) * (gnuplot_svg.plot_axis_xmax - gnuplot_svg.plot_axis_xmin);\n",
|
|
" }\n",
|
|
"\n",
|
|
" if (gnuplot_svg.plot_logaxis_y != 0) {\n",
|
|
"\ty = Math.log(gnuplot_svg.plot_axis_ymax)\n",
|
|
"\t - Math.log(gnuplot_svg.plot_axis_ymin);\n",
|
|
"\ty = y * (ploty / (gnuplot_svg.plot_ytop - gnuplot_svg.plot_ybot))\n",
|
|
"\t + Math.log(gnuplot_svg.plot_axis_ymin);\n",
|
|
"\ty = Math.exp(y);\n",
|
|
" } else {\n",
|
|
"\ty = gnuplot_svg.plot_axis_ymin + (ploty / (gnuplot_svg.plot_ytop-gnuplot_svg.plot_ybot)) * (gnuplot_svg.plot_axis_ymax - gnuplot_svg.plot_axis_ymin);\n",
|
|
" }\n",
|
|
"\n",
|
|
" plotcoord.x = x;\n",
|
|
" plotcoord.y = y;\n",
|
|
" return plotcoord;\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.convert_to_polar = function (x,y)\n",
|
|
"{\n",
|
|
" polar = new Object;\n",
|
|
" var phi, r;\n",
|
|
" phi = Math.atan2(y,x);\n",
|
|
" if (gnuplot_svg.plot_logaxis_r) \n",
|
|
" r = Math.exp( (x/Math.cos(phi) + Math.log(gnuplot_svg.plot_axis_rmin)/Math.LN10) * Math.LN10);\n",
|
|
" else if (gnuplot_svg.plot_axis_rmin > gnuplot_svg.plot_axis_rmax)\n",
|
|
" r = gnuplot_svg.plot_axis_rmin - x/Math.cos(phi);\n",
|
|
" else\n",
|
|
" r = gnuplot_svg.plot_axis_rmin + x/Math.cos(phi);\n",
|
|
" phi = phi * (180./Math.PI);\n",
|
|
" if (gnuplot_svg.polar_sense < 0)\n",
|
|
"\tphi = -phi;\n",
|
|
" if (gnuplot_svg.polar_theta0 != undefined)\n",
|
|
"\tphi = phi + gnuplot_svg.polar_theta0;\n",
|
|
" if (phi > 180.)\n",
|
|
"\tphi = phi - 360.;\n",
|
|
" polar.r = r;\n",
|
|
" polar.ang = phi;\n",
|
|
" return polar;\n",
|
|
"}\n",
|
|
"\n",
|
|
"gnuplot_svg.convert_to_DMS = function (x)\n",
|
|
"{\n",
|
|
" var dms = {d:0, m:0, s:0};\n",
|
|
" var deg = Math.abs(x);\n",
|
|
" dms.d = Math.floor(deg);\n",
|
|
" dms.m = Math.floor((deg - dms.d) * 60.);\n",
|
|
" dms.s = Math.floor((deg - dms.d) * 3600. - dms.m * 60.);\n",
|
|
" fmt = ((x<0)?\"-\":\" \")\n",
|
|
" + dms.d.toFixed(0) + \"°\"\n",
|
|
"\t+ dms.m.toFixed(0) + \"\\\"\"\n",
|
|
"\t+ dms.s.toFixed(0) + \"'\";\n",
|
|
" return fmt;\n",
|
|
"}\n",
|
|
"]]>\n",
|
|
"</script>\n",
|
|
"\n",
|
|
"<!-- Tie mousing to entire bounding box of the plot -->\n",
|
|
"<rect x=\"0\" y=\"0\" width=\"800\" height=\"400\" fill=\"#ffffff\" stroke=\"black\" stroke-width=\"1\"\n",
|
|
"onclick=\"gnuplot_svg.toggleCoordBox(evt)\" onmousemove=\"gnuplot_svg.moveCoordBox(evt)\"/>\n",
|
|
"\n",
|
|
"<!-- Also track mouse when it is on a plot element -->\n",
|
|
"<g id=\"gnuplot_canvas\" onclick=\"gnuplot_svg.toggleCoordBox(evt)\" onmousemove=\"gnuplot_svg.moveCoordBox(evt)\">\n",
|
|
"\n",
|
|
"<defs>\n",
|
|
"\n",
|
|
"\t<circle id='gpDot' r='0.5' stroke-width='0.5' stroke='currentColor'/>\n",
|
|
"\t<path id='gpPt0' stroke-width='0.222' stroke='currentColor' d='M-1,0 h2 M0,-1 v2'/>\n",
|
|
"\t<path id='gpPt1' stroke-width='0.222' stroke='currentColor' d='M-1,-1 L1,1 M1,-1 L-1,1'/>\n",
|
|
"\t<path id='gpPt2' stroke-width='0.222' stroke='currentColor' d='M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1'/>\n",
|
|
"\t<rect id='gpPt3' stroke-width='0.222' stroke='currentColor' x='-1' y='-1' width='2' height='2'/>\n",
|
|
"\t<rect id='gpPt4' stroke-width='0.222' stroke='currentColor' fill='currentColor' x='-1' y='-1' width='2' height='2'/>\n",
|
|
"\t<circle id='gpPt5' stroke-width='0.222' stroke='currentColor' cx='0' cy='0' r='1'/>\n",
|
|
"\t<use xlink:href='#gpPt5' id='gpPt6' fill='currentColor' stroke='none'/>\n",
|
|
"\t<path id='gpPt7' stroke-width='0.222' stroke='currentColor' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'/>\n",
|
|
"\t<use xlink:href='#gpPt7' id='gpPt8' fill='currentColor' stroke='none'/>\n",
|
|
"\t<use xlink:href='#gpPt7' id='gpPt9' stroke='currentColor' transform='rotate(180)'/>\n",
|
|
"\t<use xlink:href='#gpPt9' id='gpPt10' fill='currentColor' stroke='none'/>\n",
|
|
"\t<use xlink:href='#gpPt3' id='gpPt11' stroke='currentColor' transform='rotate(45)'/>\n",
|
|
"\t<use xlink:href='#gpPt11' id='gpPt12' fill='currentColor' stroke='none'/>\n",
|
|
"\t<path id='gpPt13' stroke-width='0.222' stroke='currentColor' d='M0,1.330 L1.265,0.411 L0.782,-1.067 L-0.782,-1.076 L-1.265,0.411 z'/>\n",
|
|
"\t<use xlink:href='#gpPt13' id='gpPt14' fill='currentColor' stroke='none'/>\n",
|
|
"\t<filter id='textbox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>\n",
|
|
"\t <feFlood flood-color='white' flood-opacity='1' result='bgnd'/>\n",
|
|
"\t <feComposite in='SourceGraphic' in2='bgnd' operator='atop'/>\n",
|
|
"\t</filter>\n",
|
|
"\t<filter id='greybox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'>\n",
|
|
"\t <feFlood flood-color='lightgrey' flood-opacity='1' result='grey'/>\n",
|
|
"\t <feComposite in='SourceGraphic' in2='grey' operator='atop'/>\n",
|
|
"\t</filter>\n",
|
|
"</defs>\n",
|
|
"<g fill=\"none\" color=\"white\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,364.0 L62.9,364.0 M775.0,364.0 L766.0,364.0 '/>\t<g transform=\"translate(45.6,367.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-1.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,306.3 L62.9,306.3 M775.0,306.3 L766.0,306.3 '/>\t<g transform=\"translate(45.6,310.2)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,248.7 L62.9,248.7 M775.0,248.7 L766.0,248.7 '/>\t<g transform=\"translate(45.6,252.6)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >-0.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,191.0 L62.9,191.0 M775.0,191.0 L766.0,191.0 '/>\t<g transform=\"translate(45.6,194.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,133.4 L62.9,133.4 M775.0,133.4 L766.0,133.4 '/>\t<g transform=\"translate(45.6,137.3)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 0.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,75.7 L62.9,75.7 M775.0,75.7 L766.0,75.7 '/>\t<g transform=\"translate(45.6,79.6)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L62.9,18.1 M775.0,18.1 L766.0,18.1 '/>\t<g transform=\"translate(45.6,22.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1.5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,364.0 L53.9,355.0 M53.9,18.1 L53.9,27.1 '/>\t<g transform=\"translate(53.9,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 1</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M134.0,364.0 L134.0,355.0 M134.0,18.1 L134.0,27.1 '/>\t<g transform=\"translate(134.0,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 2</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M214.1,364.0 L214.1,355.0 M214.1,18.1 L214.1,27.1 '/>\t<g transform=\"translate(214.1,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 3</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M294.3,364.0 L294.3,355.0 M294.3,18.1 L294.3,27.1 '/>\t<g transform=\"translate(294.3,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 4</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M374.4,364.0 L374.4,355.0 M374.4,18.1 L374.4,27.1 '/>\t<g transform=\"translate(374.4,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 5</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M454.5,364.0 L454.5,355.0 M454.5,18.1 L454.5,27.1 '/>\t<g transform=\"translate(454.5,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 6</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M534.6,364.0 L534.6,355.0 M534.6,18.1 L534.6,27.1 '/>\t<g transform=\"translate(534.6,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 7</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M614.8,364.0 L614.8,355.0 M614.8,18.1 L614.8,27.1 '/>\t<g transform=\"translate(614.8,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 8</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M694.9,364.0 L694.9,355.0 M694.9,18.1 L694.9,27.1 '/>\t<g transform=\"translate(694.9,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 9</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M775.0,364.0 L775.0,355.0 M775.0,18.1 L775.0,27.1 '/>\t<g transform=\"translate(775.0,385.9)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"middle\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" > 10</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L53.9,364.0 L775.0,364.0 L775.0,18.1 L53.9,18.1 Z '/></g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"\t<g id=\"gnuplot_plot_1\" ><title>sin</title>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_1_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_1')\">\n",
|
|
"\t<g transform=\"translate(707.9,40.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >sin</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb(148, 0, 211)' d='M716.2,36.1 L758.4,36.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb(148, 0, 211)' d='M53.9,94.0 L61.9,88.3 L69.9,83.6 L77.9,80.0 L85.9,77.4 L94.0,76.0 L102.0,75.8 L110.0,76.7\n",
|
|
"\t\tL118.0,78.8 L126.0,81.9 L134.0,86.2 L142.0,91.5 L150.0,97.8 L158.1,105.1 L166.1,113.2 L174.1,122.0\n",
|
|
"\t\tL182.1,131.6 L190.1,141.8 L198.1,152.4 L206.1,163.5 L214.1,174.8 L222.2,186.3 L230.2,197.8 L238.2,209.2\n",
|
|
"\t\tL246.2,220.5 L254.2,231.5 L262.2,242.1 L270.2,252.1 L278.2,261.6 L286.3,270.3 L294.3,278.3 L302.3,285.4\n",
|
|
"\t\tL310.3,291.5 L318.3,296.7 L326.3,300.8 L334.3,303.8 L342.3,305.6 L350.4,306.3 L358.4,305.9 L366.4,304.3\n",
|
|
"\t\tL374.4,301.6 L382.4,297.8 L390.4,292.9 L398.4,287.0 L406.4,280.1 L414.5,272.4 L422.5,263.8 L430.5,254.5\n",
|
|
"\t\tL438.5,244.6 L446.5,234.2 L454.5,223.3 L462.5,212.1 L470.5,200.6 L478.5,189.1 L486.6,177.6 L494.6,166.2\n",
|
|
"\t\tL502.6,155.1 L510.6,144.4 L518.6,134.1 L526.6,124.4 L534.6,115.3 L542.6,107.0 L550.7,99.5 L558.7,93.0\n",
|
|
"\t\tL566.7,87.4 L574.7,82.9 L582.7,79.4 L590.7,77.1 L598.7,75.9 L606.7,75.9 L614.8,77.0 L622.8,79.2\n",
|
|
"\t\tL630.8,82.6 L638.8,87.0 L646.8,92.5 L654.8,99.0 L662.8,106.4 L670.8,114.6 L678.9,123.6 L686.9,133.3\n",
|
|
"\t\tL694.9,143.5 L702.9,154.3 L710.9,165.4 L718.9,176.7 L726.9,188.2 L734.9,199.7 L743.0,211.1 L751.0,222.4\n",
|
|
"\t\tL759.0,233.3 L767.0,243.8 L775.0,253.8 '/></g>\n",
|
|
"\t</g>\n",
|
|
"\t<g id=\"gnuplot_plot_2\" ><title>cos</title>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_2_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_2')\">\n",
|
|
"\t<g transform=\"translate(707.9,58.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >cos</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb( 0, 158, 115)' d='M716.2,54.1 L758.4,54.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb( 0, 158, 115)' d='M53.9,128.8 L61.9,138.8 L69.9,149.3 L77.9,160.2 L85.9,171.5 L94.0,182.9 L102.0,194.4 L110.0,205.9\n",
|
|
"\t\tL118.0,217.2 L126.0,228.3 L134.0,239.0 L142.0,249.3 L150.0,258.9 L158.1,267.9 L166.1,276.1 L174.1,283.4\n",
|
|
"\t\tL182.1,289.8 L190.1,295.3 L198.1,299.7 L206.1,303.0 L214.1,305.2 L222.2,306.3 L230.2,306.2 L238.2,304.9\n",
|
|
"\t\tL246.2,302.5 L254.2,299.0 L262.2,294.4 L270.2,288.8 L278.2,282.2 L286.3,274.7 L294.3,266.4 L302.3,257.3\n",
|
|
"\t\tL310.3,247.6 L318.3,237.3 L326.3,226.5 L334.3,215.4 L342.3,204.0 L350.4,192.5 L358.4,181.0 L366.4,169.5\n",
|
|
"\t\tL374.4,158.3 L382.4,147.5 L390.4,137.0 L398.4,127.1 L406.4,117.9 L414.5,109.3 L422.5,101.6 L430.5,94.8\n",
|
|
"\t\tL438.5,88.9 L446.5,84.1 L454.5,80.3 L462.5,77.7 L470.5,76.1 L478.5,75.8 L486.6,76.5 L494.6,78.4\n",
|
|
"\t\tL502.6,81.5 L510.6,85.6 L518.6,90.8 L526.6,97.0 L534.6,104.1 L542.6,112.1 L550.7,120.9 L558.7,130.4\n",
|
|
"\t\tL566.7,140.5 L574.7,151.1 L582.7,162.1 L590.7,173.4 L598.7,184.8 L606.7,196.4 L614.8,207.8 L622.8,219.1\n",
|
|
"\t\tL630.8,230.2 L638.8,240.8 L646.8,250.9 L654.8,260.5 L662.8,269.3 L670.8,277.4 L678.9,284.6 L686.9,290.8\n",
|
|
"\t\tL694.9,296.1 L702.9,300.3 L710.9,303.4 L718.9,305.5 L726.9,306.3 L734.9,306.0 L743.0,304.6 L751.0,302.0\n",
|
|
"\t\tL759.0,298.3 L767.0,293.6 L775.0,287.8 '/></g>\n",
|
|
"\t</g>\n",
|
|
"\t<g id=\"gnuplot_plot_3\" ><title>sin+cos</title>\n",
|
|
"<g fill=\"none\" color=\"white\" stroke=\"rgb( 0, 158, 115)\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<g id=\"gnuplot_plot_3_keyentry\" visibility=\"visible\" onclick=\"gnuplot_svg.toggleVisibility(evt,'gnuplot_plot_3')\">\n",
|
|
"\t<g transform=\"translate(707.9,76.0)\" stroke=\"none\" fill=\"black\" font-family=\"Arial\" font-size=\"12.00\" text-anchor=\"end\">\n",
|
|
"\t\t<text><tspan font-family=\"Arial\" >sin+cos</tspan></text>\n",
|
|
"\t</g>\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='rgb( 86, 180, 233)' d='M716.2,72.1 L758.4,72.1 '/>\t</g>\n",
|
|
"\t<path stroke='rgb( 86, 180, 233)' d='M53.9,31.7 L61.9,36.0 L69.9,41.8 L77.9,49.1 L85.9,57.8 L94.0,67.9 L102.0,79.2 L110.0,91.6\n",
|
|
"\t\tL118.0,105.0 L126.0,119.2 L134.0,134.2 L142.0,149.7 L150.0,165.7 L158.1,181.9 L166.1,198.2 L174.1,214.4\n",
|
|
"\t\tL182.1,230.4 L190.1,246.0 L198.1,261.1 L206.1,275.4 L214.1,288.9 L222.2,301.5 L230.2,312.9 L238.2,323.1\n",
|
|
"\t\tL246.2,332.0 L254.2,339.5 L262.2,345.5 L270.2,349.9 L278.2,352.8 L286.3,354.0 L294.3,353.7 L302.3,351.7\n",
|
|
"\t\tL310.3,348.1 L318.3,342.9 L326.3,336.2 L334.3,328.1 L342.3,318.6 L350.4,307.8 L358.4,295.8 L366.4,282.8\n",
|
|
"\t\tL374.4,268.9 L382.4,254.2 L390.4,238.9 L398.4,223.1 L406.4,207.0 L414.5,190.7 L422.5,174.4 L430.5,158.3\n",
|
|
"\t\tL438.5,142.5 L446.5,127.2 L454.5,112.6 L462.5,98.7 L470.5,85.7 L478.5,73.8 L486.6,63.1 L494.6,53.6\n",
|
|
"\t\tL502.6,45.6 L510.6,38.9 L518.6,33.8 L526.6,30.3 L534.6,28.4 L542.6,28.1 L550.7,29.4 L558.7,32.3\n",
|
|
"\t\tL566.7,36.9 L574.7,42.9 L582.7,50.5 L590.7,59.4 L598.7,69.7 L606.7,81.2 L614.8,93.8 L622.8,107.3\n",
|
|
"\t\tL630.8,121.7 L638.8,136.8 L646.8,152.4 L654.8,168.4 L662.8,184.6 L670.8,200.9 L678.9,217.1 L686.9,233.1\n",
|
|
"\t\tL694.9,248.6 L702.9,263.5 L710.9,277.8 L718.9,291.1 L726.9,303.5 L734.9,314.7 L743.0,324.7 L751.0,333.3\n",
|
|
"\t\tL759.0,340.6 L767.0,346.3 L775.0,350.5 '/></g>\n",
|
|
"\t</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"2.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"black\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"\t<path stroke='black' d='M53.9,18.1 L53.9,364.0 L775.0,364.0 L775.0,18.1 L53.9,18.1 Z '/></g>\n",
|
|
"<g fill=\"none\" color=\"black\" stroke=\"currentColor\" stroke-width=\"1.00\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n",
|
|
"</g>\n",
|
|
"\n",
|
|
"<script type=\"text/javascript\"><![CDATA[\n",
|
|
"// plot boundaries and axis scaling information for mousing \n",
|
|
"gnuplot_svg.plot_term_xmax = 800;\n",
|
|
"gnuplot_svg.plot_term_ymax = 400;\n",
|
|
"gnuplot_svg.plot_xmin = 53.9;\n",
|
|
"gnuplot_svg.plot_xmax = 775.0;\n",
|
|
"gnuplot_svg.plot_ybot = 364.0;\n",
|
|
"gnuplot_svg.plot_ytop = 18.1;\n",
|
|
"gnuplot_svg.plot_width = 721.1;\n",
|
|
"gnuplot_svg.plot_height = 345.9;\n",
|
|
"gnuplot_svg.plot_axis_xmin = 1;\n",
|
|
"gnuplot_svg.plot_axis_xmax = 10;\n",
|
|
"gnuplot_svg.plot_axis_ymin = -1.5;\n",
|
|
"gnuplot_svg.plot_axis_ymax = 1.5;\n",
|
|
"gnuplot_svg.polar_mode = false;\n",
|
|
"gnuplot_svg.plot_axis_x2min = \"none\"\n",
|
|
"gnuplot_svg.plot_axis_y2min = \"none\"\n",
|
|
"gnuplot_svg.plot_logaxis_x = 0;\n",
|
|
"gnuplot_svg.plot_logaxis_y = 0;\n",
|
|
"gnuplot_svg.plot_timeaxis_x = \"\";\n",
|
|
"gnuplot_svg.plot_timeaxis_y = \"\";\n",
|
|
"]]>\n",
|
|
"</script>\n",
|
|
"</g>\n",
|
|
"\n",
|
|
" <text id=\"coord_text\" text-anchor=\"start\" pointer-events=\"none\"\n",
|
|
" font-size=\"12\" font-family=\"Arial\"\n",
|
|
" visibility=\"hidden\"> </text>\n",
|
|
"\n",
|
|
" <rect id=\"hypertextbox\" class=\"hypertextbox\" pointer-events=\"none\"\n",
|
|
" fill=\"white\" stroke=\"black\" opacity=\"0.8\"\n",
|
|
" height=\"16\" visibility=\"hidden\" />\n",
|
|
"\n",
|
|
" <text id=\"hypertext\" class=\"hypertext\" pointer-events=\"none\"\n",
|
|
" font-size=\"12\" font-family=\"Arial\"\n",
|
|
" visibility=\"hidden\"> </text>\n",
|
|
"\n",
|
|
" <image id=\"hyperimage\" class=\"hyperimage\" pointer-events=\"none\"\n",
|
|
" fill=\"white\" stroke=\"black\" opacity=\"0.8\"\n",
|
|
" height=\"200\" width=\"300\" visibility=\"hidden\" />\n",
|
|
"</svg>\n",
|
|
"\n"
|
|
],
|
|
"text/plain": []
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"display(@gp :dummy)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Clearly, the plot appears in the same notebook, even if the session is different.\n",
|
|
"\n",
|
|
"## Summary\n",
|
|
"\n",
|
|
"The following tables summarize the main aspects of the approaches discussed above:\n",
|
|
"\n",
|
|
"\n",
|
|
"| `Gnuplot.options.gpviewer = true` | REPL, Jupyter or Juno\n",
|
|
"| :------------- | :-------------:\n",
|
|
"| Plots are shown | in dedicated window(s)\n",
|
|
"| Updating a plot | updates window content\n",
|
|
"| Output of different session goes to | separate windows\n",
|
|
"| How many simultaneous plots can be shown? | all windows fitting the screen\n",
|
|
"| Calls to `display()` / automatic display (trailing `;`) | does nothing / not applicable\n",
|
|
"| The top level code works also within a function? | yes, explicit `display()` calls are not required\n",
|
|
"| Terminal options are specified in | `Gnuplot.options.term`\n",
|
|
"\n",
|
|
"\n",
|
|
"| `Gnuplot.options.gpviewer = false` | REPL | Jupyter | Juno\n",
|
|
"| :------------- | :-------------: | :------------: | :-------------:\n",
|
|
"| Plots are shown | not shown | as inline images in the notebook | as image in the plot pane\n",
|
|
"| Updating a plot | not shown | creates a separate image | overwrites the plot pane content\n",
|
|
"| Output of different session goes to | not shown | the same notebook | the plot pane\n",
|
|
"| How many simultaneous plots can be shown? | not shown | all those fitting in the visible part of the notebook | only one\n",
|
|
"| Calls to `display()` / automatic display (trailing `;`) | not applicable | updates the plot / applicable | updates the plot / applicable\n",
|
|
"| The top level code works also within a function? | not applicable | no, explicit `display()` calls are required | no, explicit `display()` calls are are required\n",
|
|
"| Terminal options are specified in | not applicable | `Gnuplot.options.mime` | `Gnuplot.options.mime`\n"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Julia 1.4.0",
|
|
"language": "julia",
|
|
"name": "julia-1.4"
|
|
},
|
|
"language_info": {
|
|
"file_extension": ".jl",
|
|
"mimetype": "application/julia",
|
|
"name": "julia",
|
|
"version": "1.4.0"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
}
|