2020-05-09 14:42:57 +00:00
|
|
|
|
<!doctype html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
2020-04-29 08:37:43 +00:00
|
|
|
|
<meta charset="utf-8">
|
2020-05-09 14:42:57 +00:00
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
2020-04-29 08:37:43 +00:00
|
|
|
|
|
2022-10-31 07:44:05 +00:00
|
|
|
|
<link rel="stylesheet" href="../style.css" type="text/css" />
|
2020-05-09 14:42:57 +00:00
|
|
|
|
<title>利用浏览器地址栏对函数作图</title>
|
2022-06-30 03:43:09 +00:00
|
|
|
|
<script type="text/javascript">
|
2022-07-12 02:24:02 +00:00
|
|
|
|
function findLang(){
|
2022-06-30 03:43:09 +00:00
|
|
|
|
let href = location.href;
|
|
|
|
|
for(let i=href.length-1;i>0;i--){
|
|
|
|
|
if('/'==href.charAt(i) && '/'==href.charAt(i-3))
|
2022-07-12 02:24:02 +00:00
|
|
|
|
return i;
|
2022-06-30 03:43:09 +00:00
|
|
|
|
}
|
2022-07-12 02:24:02 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
function nav2(page){
|
|
|
|
|
let i = findLang();
|
|
|
|
|
location.href = location.href.substring(0,i+1)+page;
|
|
|
|
|
}
|
|
|
|
|
function nav2Lang(lang){
|
|
|
|
|
let i = findLang();
|
|
|
|
|
let href = location.href;
|
|
|
|
|
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
|
2022-06-30 03:43:09 +00:00
|
|
|
|
}
|
|
|
|
|
</script>
|
2020-05-09 14:42:57 +00:00
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<header class='header'>
|
2022-06-30 03:43:09 +00:00
|
|
|
|
<a class="logo" href="javascript:void(0)" onclick="return nav2('index.html')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html')">Tags</a>
|
2022-07-12 02:24:02 +00:00
|
|
|
|
|
2020-05-09 14:42:57 +00:00
|
|
|
|
<nav>
|
|
|
|
|
</nav>
|
|
|
|
|
</header>
|
2020-08-29 00:42:46 +00:00
|
|
|
|
<br />
|
2020-04-29 08:37:43 +00:00
|
|
|
|
|
2020-05-09 14:42:57 +00:00
|
|
|
|
<div class="container">
|
|
|
|
|
<h1 class="title">利用浏览器地址栏对函数作图
|
|
|
|
|
<br>
|
|
|
|
|
<span class="subtitle"></span>
|
|
|
|
|
</h1>
|
|
|
|
|
<ul class="tags">
|
2020-04-29 08:37:43 +00:00
|
|
|
|
|
2020-10-08 07:39:48 +00:00
|
|
|
|
<li><a href="../tags/termux">termux</a> </li>
|
2020-04-29 08:37:43 +00:00
|
|
|
|
|
2020-05-09 14:42:57 +00:00
|
|
|
|
</ul>
|
2022-03-19 08:53:04 +00:00
|
|
|
|
<p>使用Android端<a href="../index.html">uweb浏览器</a>。<br>
|
2020-05-09 14:42:57 +00:00
|
|
|
|
Termux提供了方便的软件包管理系统,缺省的uWeb地址栏功能配置需用到作图软件gnuplot。</p>
|
|
|
|
|
<h4 id="安装gnuplot">安装gnuplot</h4>
|
|
|
|
|
<ul>
|
2020-10-11 00:18:45 +00:00
|
|
|
|
<li>安装 <a href="../searchurl/plugins.html">uweb定制Termux应用</a></li>
|
|
|
|
|
<li>Termux下运行以下命令:<br>
|
|
|
|
|
apt update<br>
|
|
|
|
|
apt upgrade<br>
|
2020-05-09 14:42:57 +00:00
|
|
|
|
apt install gnuplot</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<h4 id="地址栏功能配置">地址栏功能配置:</h4>
|
|
|
|
|
<ul>
|
2022-07-09 00:45:17 +00:00
|
|
|
|
<li>配置文件<a href=e:default.acmd>default.acmd</a>每行格式如下:<br>
|
2020-05-09 14:42:57 +00:00
|
|
|
|
菜单名:mimeType:命令行</li>
|
2020-04-29 08:37:43 +00:00
|
|
|
|
<li>命令行可包含参数%s,运行时自动用地址栏输入内容替换。</li>
|
|
|
|
|
<li>如果浏览器窗口当前地址为本地url,则此目录同时作为命令行工作目录。</li>
|
|
|
|
|
</ul>
|
2022-07-09 00:45:17 +00:00
|
|
|
|
<h4 id="配置文件defaultacmd如下">配置文件default.acmd如下:</h4>
|
2020-05-09 14:42:57 +00:00
|
|
|
|
<pre><code>命令:text/plain:%s
|
|
|
|
|
函数作图:image/svg+xml:gnuplot -e 'set term svg;set output; plot %s'
|
|
|
|
|
函数作图(3d):image/svg+xml:gnuplot -e 'set term svg;set output; splot %s'
|
2020-04-29 08:37:43 +00:00
|
|
|
|
超级计算器:text/html:echo "%s"|bc -l -q
|
2020-05-09 14:42:57 +00:00
|
|
|
|
</code></pre>
|
|
|
|
|
<p>长按uweb浏览器底部工具条刷新按钮弹出地址栏功能选择,选择“函数作图”,地址栏内输入函数如sin(x)**5就可显示函数图案。</p>
|
|
|
|
|
<h4 id="常见问题及诊断">常见问题及诊断</h4>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>确保gnuplot正确安装,在Termux提示符下,敲入gnuplot,然后回车,保证出现"gnuplot>"。</li>
|
|
|
|
|
<li>确保gnuplot正常运行, 在Termux提示符下,执行下面命令:<br>
|
|
|
|
|
<code>gnuplot -e 'set term svg;set output; plot x'</code><br>
|
|
|
|
|
屏幕输出应该为正常的svg文件(类似html文本)。</li>
|
2020-04-29 08:37:43 +00:00
|
|
|
|
<li>Termux应为uweb定制包,否则有一堆设定需要修改。</li>
|
|
|
|
|
<li>超微浏览器下长按设置按钮,勾选“标准错误输出”。再次在地址栏执行画图操作,此时浏览器会显示出错信息。</li>
|
2020-05-09 14:42:57 +00:00
|
|
|
|
<li>为保证地址栏输入函数符合gnuplot规范,首个测试函数建议为"x",即整个地址栏内输入为"x"。</li>
|
2020-04-29 08:37:43 +00:00
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
</div>
|
2023-03-05 03:12:05 +00:00
|
|
|
|
<p>Last Modified: 24 September 2022<br>
|
2023-03-07 02:07:05 +00:00
|
|
|
|
remove /sdcard/uweb folder<br>
|
|
|
|
|
<pre></pre>
|
|
|
|
|
</p>
|
2023-05-06 01:56:44 +00:00
|
|
|
|
<script id='jsgiscus'
|
|
|
|
|
src='https://giscus.app/client.js'
|
|
|
|
|
data-repo="torappinfo/uweb"
|
|
|
|
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
|
|
|
|
|
data-category="Announcements"
|
|
|
|
|
data-category-id="DIC_kwDOEgNLGc4CQjsh"
|
2023-05-06 02:49:29 +00:00
|
|
|
|
data-mapping="title"
|
2023-05-06 01:56:44 +00:00
|
|
|
|
data-strict="0"
|
|
|
|
|
data-reactions-enabled="1"
|
|
|
|
|
data-emit-metadata="0"
|
|
|
|
|
data-input-position="top"
|
|
|
|
|
data-theme="light"
|
|
|
|
|
data-lang="en"
|
|
|
|
|
data-loading="lazy"
|
2023-05-06 02:49:29 +00:00
|
|
|
|
crossorigin="anonymous" async>
|
2023-05-06 01:40:28 +00:00
|
|
|
|
</script>
|
2020-04-29 08:37:43 +00:00
|
|
|
|
|
2020-05-09 14:42:57 +00:00
|
|
|
|
</body>
|
2020-04-29 08:37:43 +00:00
|
|
|
|
</html>
|