﻿{"id":21393,"date":"2023-05-05T08:25:53","date_gmt":"2023-05-05T00:25:53","guid":{"rendered":"https:\/\/www.linuxmi.com\/?p=21393"},"modified":"2023-05-04T20:43:57","modified_gmt":"2023-05-04T12:43:57","slug":"linux-youplot","status":"publish","type":"post","link":"https:\/\/www.linuxmi.com\/linux-youplot.html","title":{"rendered":"\u5982\u4f55\u5728 Linux \u7ec8\u7aef\u4e2d\u4f7f\u7528 YouPlot \u521b\u5efa\u6570\u636e\u53ef\u89c6\u5316"},"content":{"rendered":"<p>\u6570\u636e\u88ab\u79f0\u4e3a\u65b0\u7684\u77f3\u6cb9\uff0c\u4f46\u6570\u636e\u7684\u5b9e\u9645\u6548\u679c\u5e38\u5e38\u53d6\u51b3\u4e8e\u60a8\u5982\u4f55\u5448\u73b0\u5b83\u3002<\/p>\n<p>\u56fe\u8868\u3001\u56fe\u5f62\u548c\u7ed8\u56fe\u53ef\u4ee5\u8ba9\u60a8\u548c\u60a8\u7684\u53d7\u4f17\u5728\u77ac\u95f4\u83b7\u5f97\u4e00\u4e2a\u6982\u89c8\uff0c\u800c\u8fd9\u662f\u6570\u5b57\u8868\u683c\u65e0\u6cd5\u505a\u5230\u7684\u3002\u4e0b\u9762\u4ecb\u7ecd\u5982\u4f55\u5728 Linux \u7ec8\u7aef\u4e2d\u521b\u5efa\u4ee4\u4eba\u60ca\u53f9\u7684\u6570\u636e\u53ef\u89c6\u5316\u3002<\/p>\n<h2><strong>\u56fe\u8868\u5bf9\u4e8e\u5c55\u793a\u6570\u636e\u81f3\u5173\u91cd\u8981 <\/strong><\/h2>\n<p>\u6570\u5b57\u6570\u636e\u662f\u53d1\u5c55\u79d1\u5b66\u77e5\u8bc6\u548c\u505a\u51fa\u51b3\u7b56\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002\u5982\u679c\u6ca1\u6709\u5148\u524d\u7ed3\u679c\u7684\u4e00\u4e9b\u77e5\u8bc6\uff0c\u60a8\u6240\u505a\u7684\u4efb\u4f55\u51b3\u7b56\u90fd\u548c\u629b\u786c\u5e01\u5dee\u4e0d\u591a\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u4f60\u5728\u8bb0\u5f55\u786c\u5e01\u6295\u63b7\u7684\u6570\u636e\uff0c\u6295\u63b7\u4e24\u6b21\u786c\u5e01\uff0c\u5f88\u6709\u53ef\u80fd\u90fd\u4f1a\u662f\u6b63\u9762\u3002\u5982\u679c\u53ea\u6709\u8fd9\u4e2a\u6570\u636e\uff0c\u4f60\u4e5f\u8bb8\u4f1a\u8ba4\u4e3a\u63a5\u4e0b\u6765\u7684\u786c\u5e01\u6295\u63b7\u4e5f\u4f1a\u662f\u6b63\u9762\u3002\u4e8e\u662f\u4f60\u4f1a\u8003\u8651\u62b5\u62bc\u4f60\u7684\u623f\u5b50\u3001\u6216\u8005\u4e0d\u60dc\u4e00\u5207\u4ee3\u4ef7\uff0c\u5e76\u628a\u4f60\u6240\u6709\u7684\u8d22\u4ea7\u90fd\u62bc\u5728\u4e0b\u4e00\u6b21\u629b\u786c\u5e01\u6b63\u9762\u671d\u4e0a\u3002<\/p>\n<p>\u4f46\u662f\u5982\u679c\u4f60\u6709\u66f4\u591a\u7684\u786c\u5e01\u6295\u63b7\u6570\u636e\uff0c\u4f60\u4f1a\u53d1\u73b0\uff0c\u968f\u7740\u6570\u636e\u70b9\u7684\u589e\u591a\uff0c\u6295\u63b7\u786c\u5e01\u6b63\u9762\u671d\u4e0a\u7684\u6982\u7387\u4f1a\u9010\u6e10\u964d\u4f4e\u81f3\u5927\u7ea650%\uff0c\u8fd9\u65f6\u4f60\u5c31\u4f1a\u610f\u8bc6\u5230\u4e0d\u518d\u662f\u4e2a\u597d\u4e3b\u610f\u4e86\u3002<\/p>\n<p>\u5982\u679c\u4f60\u5c06\u6570\u636e\u8bb0\u5f55\u5728\u4e00\u5f20\u8868\u683c\u4e2d\uff0c\u90a3\u4e48\u5728\u4e00\u773c\u626b\u8fc7\u6570\u5343\u4e2a\u6570\u636e\u70b9\u7684\u60c5\u51b5\u4e0b\uff0c\u7406\u89e3\u5927\u91cf\u6570\u636e\u53ef\u80fd\u5f88\u56f0\u96be\u3002\u5982\u679c\u4e0d\u80fd\u5feb\u901f\u8bc6\u522b\u51fa\u8d8b\u52bf\u3001\u5206\u7c7b\u548c\u5f02\u5e38\u503c\uff0c\u5f88\u5bb9\u6613\u5f97\u51fa\u9519\u8bef\u7684\u63a8\u65ad\u548c\u505a\u51fa\u7cdf\u7cd5\u7684\u51b3\u7b56\u3002\u800c\u56fe\u8868\u53ef\u4ee5\u5c06\u539f\u59cb\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u4f7f\u4f60\u53ef\u4ee5\u5feb\u901f\u6d4f\u89c8\uff0c\u7acb\u523b\u53d1\u73b0\u8d8b\u52bf\u3001\u5206\u7c7b\u548c\u5f02\u5e38\u503c\uff0c\u4ece\u800c\u5f97\u51fa\u6b63\u786e\u7684\u7ed3\u8bba\u548c\u505a\u51fa\u660e\u667a\u7684\u51b3\u7b56\u3002<\/p>\n<h2><strong>\u4ec0\u4e48\u662f YouPlot?<\/strong><\/h2>\n<p>YouPlot \u662f\u4e00\u6b3e\u5728 Linux \u7ec8\u7aef\u4e2d\u7ed8\u5236\u56fe\u5f62\u548c\u56fe\u8868\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002\u8be5\u7a0b\u5e8f\u652f\u6301\u5c06\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684\u503c\uff08TSV\uff09\u6587\u4ef6\u4f5c\u4e3a\u8f93\u5165\uff0c\u5e76\u8fd4\u56de\u7f8e\u89c2\u683c\u5f0f\u7684\u6563\u70b9\u56fe\u3001\u7bb1\u7ebf\u56fe\u3001\u76f4\u65b9\u56fe\u3001\u6761\u5f62\u56fe\u7b49\u591a\u79cd\u56fe\u5f62\u3002<\/p>\n<p>\u9664\u4e86\u53ef\u4ee5\u5c06\u672c\u5730\u6587\u4ef6\u4f20\u8f93\u5230 YouPlot \u4e2d\u8fdb\u884c\u5904\u7406\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u901a\u8fc7\u5c06\u6807\u51c6\u8f93\u51fa\u4f5c\u4e3a\u547d\u4ee4\u7684\u4e00\u90e8\u5206\u901a\u8fc7\u7ba1\u9053\u4f20\u8f93\u7ed9 YouPlot\uff0c\u5728\u7ebf\u4e0a\u751f\u6210\u76f8\u5e94\u7684\u56fe\u5f62\u3002<\/p>\n<h2 id=\"how-to-install-youplot-on-linux\">\u5982\u4f55\u5728 Linux \u4e0a\u5b89\u88c5 YouPlot<\/h2>\n<p>YouPlot \u662f\u4e00\u4e2a\u53ef\u4ee5\u5728 Linux \u7ec8\u7aef\u4e2d\u7ed8\u5236\u6563\u70b9\u56fe\u3001\u7bb1\u7ebf\u56fe\u3001\u76f4\u65b9\u56fe\u3001\u67f1\u72b6\u56fe\u7b49\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002\u8be5\u7a0b\u5e8f\u63a5\u53d7\u4ee5\u5236\u8868\u7b26\u5206\u9694\u503c (TSV) \u6587\u4ef6\u4e3a\u8f93\u5165\uff0c\u5e76\u8fd4\u56de\u7cbe\u7f8e\u683c\u5f0f\u5316\u7684\u56fe\u8868\u3002<\/p>\n<p>\u9664\u4e86\u53ef\u4ee5\u5c06\u672c\u5730\u6587\u4ef6\u8f93\u5165\u5230 YouPlot \u4e2d\uff0c\u60a8\u8fd8\u53ef\u4ee5\u901a\u8fc7\u5c06\u6807\u51c6\u8f93\u51fa\u4f5c\u4e3a\u547d\u4ee4\u7684\u4e00\u90e8\u5206\u4f20\u8f93\u5230 YouPlot \u4e2d\uff0c\u5b9e\u65f6\u751f\u6210\u7ed8\u56fe\u3002<\/p>\n<p>\u867d\u7136 YouPlot \u4e5f\u53ef\u4ee5\u4f5c\u4e3a Ruby Gem \u4f7f\u7528\uff0c\u4f46\u5728 Linux \u4e0a\u6700\u7b80\u5355\u7684\u5b89\u88c5\u65b9\u6cd5\u662f\u901a\u8fc7 Homebrew \u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5\u3002\u7531\u4e8e\u8bb8\u591a Linux \u53d1\u884c\u7248\u5e76\u6ca1\u6709\u9884\u88c5 Homebrew\uff0c\u56e0\u6b64\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u60a8\u5e94\u8be5\u5728 Linux \u7cfb\u7edf\u4e0a\u5b89\u88c5 Homebrew\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5 YouPlot\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"null\">brew install youplot<\/code><\/pre>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21396\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/05\/youplot-1.png\" alt=\"\" width=\"1836\" height=\"994\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-21397\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/05\/youplot-2.png\" alt=\"\" width=\"1836\" height=\"1192\" \/><\/h2>\n<h2><strong>\u4f7f\u7528 YouPlot \u5728\u60a8\u7684 Linux \u7ec8\u7aef\u4e2d\u5236\u4f5c\u7f8e\u5999\u7684\u56fe\u8868<\/strong><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21402\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/05\/youplot-6.png\" alt=\"\" width=\"1836\" height=\"1786\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u00a0<strong>youplot<\/strong>\u00a0\u6216\u00a0<strong>uplot<\/strong>\u00a0\u8c03\u7528 YouPplot\uff0c\u57fa\u672c\u547d\u4ee4\u7ed3\u6784\u4e3a\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"null\">uplot &lt;command&gt; &lt;options&gt; &lt;input file&gt;<\/code><\/pre>\n<p><strong>\u547d\u4ee4<\/strong>\u5f00\u5173\u662f\u60a8\u8981\u751f\u6210\u7684\u7ed8\u56fe\u7c7b\u578b\u3002\u6700\u5e38\u89c1\u7684\u662f\uff1a<\/p>\n<table style=\"height: 300px;\" border=\"1\" width=\"500\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<th colspan=\"1\" rowspan=\"1\">\u547d\u4ee4<\/th>\n<th colspan=\"1\" rowspan=\"1\">\u884c\u52a8<\/th>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">bar<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7ed8\u5236\u6c34\u5e73\u6761\u56fe<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">hist<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7ed8\u5236\u6c34\u5e73\u76f4\u65b9\u56fe<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">line<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7ed8\u5236\u7ebf\u56fe<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">lines<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7ed8\u5236\u5177\u6709\u591a\u4e2a\u5e8f\u5217\u7684\u7ebf\u56fe<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">scatter<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7ed8\u5236\u6563\u70b9\u56fe<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">d<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7ed8\u5236\u5bc6\u5ea6\u56fe<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">box<\/td>\n<td colspan=\"1\" rowspan=\"1\">\u7ed8\u5236\u7bb1\u7ebf\u56fe<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u53ef\u7528\u9009\u9879\u56e0\u60a8\u4f7f\u7528\u7684\u7ed8\u56fe\u7c7b\u578b\u800c\u5f02\u3002 \u8981\u67e5\u770b\u6bcf\u79cd\u7c7b\u578b\u7684\u53ef\u7528\u9009\u9879\uff0c\u8bf7\u4f7f\u7528 &#8211;help \u5f00\u5173\u3002 \u5982\u679c\u60a8\u60f3\u67e5\u770b\u53ef\u4ee5\u4f7f\u7528\u6563\u70b9\u56fe\u505a\u4ec0\u4e48\uff0c\u60a8\u53ef\u4ee5\u8f93\u5165\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"null\">uplot scatter --help<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21398\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/05\/youplot-3.png\" alt=\"\" width=\"1836\" height=\"1324\" \/><\/p>\n<p>YouPlot \u5f00\u53d1\u4eba\u5458\u4ee5 TSV \u683c\u5f0f\u63d0\u4f9b\u4e86\u4e00\u4e9b\u51fa\u8272\u7684\u793a\u4f8b\u6570\u636e\uff0c\u4ee5\u4fbf\u60a8\u63a2\u7d22 YouPlot \u51fd\u6570\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u4e0b\u8f7d\u5b83\uff1a<\/p>\n<pre><code class=\"hljs console\">wget https:\/\/raw.githubusercontent.com\/kojix2\/youplot\/main\/test\/fixtures\/IRIStsv.tsv<\/code><\/pre>\n<p>\u8be5\u6570\u636e\u4e0e\u5f00\u82b1\u690d\u7269\u6709\u5173\uff0c\u5e76\u7ed9\u51fa\u4e86\u843c\u7247\u957f\u5ea6\u3001\u843c\u7247\u5bbd\u5ea6\u3001\u82b1\u74e3\u957f\u5ea6\u3001\u82b1\u74e3\u5bbd\u5ea6\u548c\u7269\u79cd\u7684\u6307\u6807\u3002<\/p>\n<p>\u8981\u7ed8\u5236\u57fa\u672c\u7bb1\u7ebf\u56fe\uff0c\u8bf7\u8f93\u5165<\/p>\n<pre><code class=\"hljs console\">uplot box IRIStsv.tsv<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21399\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/05\/youplot-4.png\" alt=\"\" width=\"1860\" height=\"1522\" \/>\u00a0\u8fd9\u4e0d\u662f\u7279\u522b\u6709\u7528\uff0c\u56e0\u4e3a\u7ed8\u56fe\u6ca1\u6709\u8f74\u6807\u7b7e\u6216\u6807\u9898\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528 &#8211;<strong>-xlabel<\/strong>\u3001<strong>ylabel<\/strong>\u00a0\u548c &#8211;<strong>-title<\/strong>\u00a0\u5f00\u5173\u6dfb\u52a0\u8fd9\u4e9b\u5185\u5bb9\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u6709\u4e00\u4e2a TSV \u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u5305\u542b\u4e0d\u540c\u7ed8\u56fe\u7c7b\u578b\u7684\u611f\u77e5\u51b7\u5374\u56e0\u5b50\u7684\u6570\u636e\uff0c\u5219\u663e\u793a\u6b64\u6570\u636e\uff1a<\/p>\n<pre><code class=\"hljs console\">uplot box --title 'How cool are these graphs?' --xlabel 'coolness rating' --ylabel 'type'<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-21400\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/05\/youplot-5.png\" alt=\"\" width=\"1860\" height=\"1786\" \/><\/p>\n<p>\u751f\u6210\u7684\u56fe\u5c06\u7c7b\u4f3c\u4e8e\u4e0a\u56fe\u4e2d\u663e\u793a\u7684\u56fe\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21401\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/05\/youplot-7.png\" alt=\"\" width=\"1836\" height=\"1720\" \/><\/p>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u4ece\u53e6\u4e00\u4e2a\u7a0b\u5e8f\u7684\u6807\u51c6\u8f93\u51fa\u4e2d\u7ba1\u9053\u8f93\u5165\u3002YouPlot\u5f00\u53d1\u4eba\u5458\u7ed9\u51fa\u7684\u4e00\u4e2a\u5f88\u597d\u7684\u4f8b\u5b50\u662f\uff1a<\/p>\n<pre><code class=\"hljs console\">python3 -c 'from math import sin, pidata = \"\\n\".join(f\"{i*pi\/50}\\t{sin(i*pi\/50)}\" for i in range(101))print(data)' | uplot line<\/code><\/pre>\n<p>\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u751f\u6210 101 \u4e2a\u5236\u8868\u7b26\u5206\u9694\u7684\u503c\uff0c\u5e76\u5c06\u5b83\u4eec\u901a\u8fc7\u7ba1\u9053\u4f20\u8f93\u5230 YouPlot\uff0c\u4ece\u800c\u4ea7\u751f\u4ee4\u4eba\u6109\u60a6\u7684\u6b63\u5f26\u6ce2\u3002<\/p>\n<h2 id=\"visualize-data-as-plots-in-your-linux-terminal\">\u5c06\u6570\u636e\u53ef\u89c6\u5316\u4e3aLinux\u7ec8\u7aef\u4e2d\u7684\u7ed8\u56fe\uff01<\/h2>\n<p>YouPlot \u53ef\u4ee5\u5728\u60a8\u7684 Linux \u7ec8\u7aef\u4e2d\u663e\u793a\u7684\u5185\u5bb9\u6ca1\u6709\u9650\u5236\uff0c\u4f46\u5982\u679c\u60a8\u66f4\u559c\u6b22\u66f4\u4f20\u7edf\u7684\u6570\u636e\u53ef\u89c6\u5316\u65b9\u5f0f\uff0c\u5219\u6709\u5f88\u591a GUI \u9009\u9879\u53ef\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6570\u636e\u88ab\u79f0\u4e3a\u65b0\u7684\u77f3\u6cb9\uff0c\u4f46\u6570\u636e\u7684\u5b9e\u9645\u6548\u679c\u5e38\u5e38\u53d6\u51b3\u4e8e\u60a8\u5982\u4f55\u5448\u73b0\u5b83\u3002 \u56fe\u8868\u3001\u56fe\u5f62\u548c\u7ed8\u56fe\u53ef\u4ee5\u8ba9\u60a8\u548c\u60a8\u7684\u53d7\u4f17\u5728\u77ac &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[605],"class_list":["post-21393","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux"],"aioseo_notices":[],"views":950,"_links":{"self":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/21393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/comments?post=21393"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/21393\/revisions"}],"predecessor-version":[{"id":21403,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/21393\/revisions\/21403"}],"wp:attachment":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/media?parent=21393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/categories?post=21393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/tags?post=21393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}