【gnuplot】gnuplot安装与简易使用
gnuplot安装(202203)
文章目录
- gnuplot安装(202203)
- 安装与使用
- 常见错误
- 参考
- gnuplot-tutorial-part
- 其他阅读
- 安装
- 函数
- Plot && Splot
- Plotting Functions
- Plotting Data
- 自定义PLOT
- plot自定义
- 使用set自定义
- 用其他注释字符绘制数据文件
- GNUPLOT SCRIPTS
使用ns3时需要用到gnuplot
gnuplot aa
rm aa
安装与使用
以下操作在su下进行,make install时否则会有权限错误
下载
wget https://nchc.dl.sourceforge.net/project/gnuplot/gnuplot/5.0.5/gnuplot-5.0.5.tar.gz
解压
tar -zxvf gnuplot-5.0.5.tar.gz
配置安装路径
cd gnuplot-5.0.5./configure --prefix=/usr/local/gnuplot
编译
make
安装
make install
配置编译环境
在/etc/profile.d下创建gnuplot.sh
vim /etc/profile.d/gnuplot.sh
写入内容
export GNUPLOT=/usr/local/gnuplot
export PATH=/usr/local/gnuplot/bin:$PATH
export MANPATH=/usr/local/gnuplot/share/man/man1:$MANPATH
启用环境
source /etc/profile.d/gnuplot.sh
安装成功
常见错误
error:terminal type set to 'unknown'
解决
安装gnuplot-x11
apt-get install gnuplot-x11
在home下新建.octaverc,内容如下
setenv("GNUTERM","X11")
重启
参考
https://www.jianshu.com/p/8087e2fd7835
https://blog.csdn.net/lx_ros/article/details/74296181
gnuplot-tutorial-part
该tutorial适用版本-version 4.2
其他阅读
http://www.gnuplot.info/documentation.html Official gnuplot documentation
http://ouc.ai/zhenghaiyong/courses/tutorials/gnuplot/gnuplot-zh.pdf 使用 gnuplot 科学作图 Gnuplot 中文教程∗
安装
略
函数
通常,可以绘制 C、FORTRAN、Pascal 或 BASIC 接受的任何数学表达式。运算符的优先级由 C 编程语言的规范决定。
支持的功能包括:(变量名 x、y 和 z 用作默认自变量。)
__________________________________________________________函数返回------------ ------------------------------------ ------ abs(x) x 的绝对值,|x| acos(x) x 的反余弦asin(x) x 的反正弦 atan(x) x 的反正切cos(x) x 的余弦,x 的单位是弧度。cosh(x) x 的双曲余弦,x 为弧度erf(x) x 的误差函数exp(x) x 的指数函数,底数为 e inverf(x) x 的逆误差函数invnorm(x) x 的逆正态分布log(x) log of x, base e log10(x) log of x, base 10 norm(x) 正态高斯分布函数rand(x) 伪随机数生成器 sgn(x) 1 if x > 0, -1 if x < 0, 0 如果 x=0 sin(x) x 的正弦,x 的弧度sinh(x) x 的双曲正弦,x 的弧度sqrt(x) x 的平方根tan(x) x 的正切, x 是弧度tanh(x) x 的双曲正切,x 是弧度___________________________________________________________ Bessel、gamma、ibeta、igamma 和 lgamma 函数也是支持的。许多函数可以接受复杂的参数。还支持二元和一元运算符。
Gnuplot 中支持的运算符与 C 编程语言中相应的运算符相同,除了大多数运算符接受整数、实数和复数参数。在 FORTRAN 中支持 ** 运算符(求幂)。括号可用于更改评估顺序。
plot 和 splot 是 Gnuplot 中的主要命令。他们以多种方式绘制函数和数据。
plot 用于绘制 2-d 函数和数据,
splot绘制 3-d 表面和数据。
语法:plot {[ranges]} {[function] | {"[datafile]" {datafile-modifiers}}} {axes [axes] } { [title-spec] } {with [style] } {, {definitions,} [function] ...}
其中提供了 [function] 或用引号括起来的数据文件的名称。
plot {<ranges>} <plot-element> {, <plot-element>, <plot-element>}Each plot element consists of a definition, a function, or a data sourcetogether with optional properties or modifiers:plot-element:{<iteration>}<definition> | {sampling-range} <function> | <data source>| keyentry{axes <axes>} {<title-spec>}{with <style>}
Plot && Splot
Plotting Functions
要绘制函数,只需在 gnuplot> 提示符下键入:plot [function]。
例如,尝试:
gnuplot> plot sin(x)/x gnuplot> splot sin(x*y/20) gnuplot> plot sin(x) title 'Sine Function', tan(x) title 'Tangent'
Plotting Data
文件中包含的离散数据可以通过在绘图或split命令行中指定数据文件的名称(用引号括起来)来显示。
- 数据文件中的数据应以数字列的形式排列。各列之间应只用空白处(制表符或空格)隔开(没有逗号)。
- 以#字符开头的行被视为注释,并被Gnuplot所忽略。
- 数据文件中的空白行会导致连接数据点的线断开。
下图为可以示例文件
# 这个文件叫做 force.dat # Force-Deflection data for a beam and a bar # Deflection Col-Force Beam-Force 0.000 0 0 0.001 104 51 0.002 202 101 0.003 298 148 0.0031 290 149 0.004 289 201 0.0041 2910205 250 0.010 311 260 0.020 280 240
可以通过键入以下内容来显示您的数据:
gnuplot> 使用 1:2 标题“列”绘制“force.dat”,\ “force.dat”使用 1:3 标题“梁”
不要在行继续符 “” 之后键入空格。
您的数据可能位于多个数据文件中。
gnuplot> plot "fileA.dat" using 1:2 title 'data A', \"fileB.dat" using 1:3 title 'data B'
自定义PLOT
绘图上可以自定义许多项目,例如轴的范围、x 和 y 轴的标签、数据点的样式、连接数据点的线的样式以及整个绘图的标题。
plot自定义
Plots may be displayed in one of eight styles: lines, points, linespoints, impulses, dots, steps, fsteps, histeps, errorbars, xerrorbars, yerrorbars, xyerrorbars, boxes, boxerrorbars, boxxyerrorbars, financebars, candlesticks or vector
指定线/点样式(line/point style)使用plot 命令如下:
gnuplot> plot "force.dat" using 1:2 title 'Column' with lines, \ "force.dat" u 1:3 t 'Beam' wlinespoints
请注意: using 、 title 和 with 可以缩写为: u 、 t 和 w 。
此外,每个线和点样式都有一个关联的编号。
使用set自定义
使用 set 命令指定轴范围、轴标签和绘图标题以及许多其他功能的自定义
set 命令的具体示例如下。(这些示例中使用的数值是任意的。)
Create a title: > set title "Force-Deflection Data" Put a label on the x-axis: > set xlabel "Deflection (meters)"Put a label on the y-axis: > set ylabel "Force (kN)"Change the x-axis range: > set xrange [0.001:0.005]Change the y-axis range: > set yrange [20:500]Have Gnuplot determine ranges: > set autoscaleMove the key: > set key 0.01,100Delete the key: > unset keyPut a label on the plot: > set label "yield point" at 0.003, 260 Remove all labels: > unset labelPlot using log-axes: > set logscalePlot using log-axes on y-axis: > unset logscale; set logscale y Change the tic-marks: > set xtics (0.002,0.004,0.006,0.008)Return to the default tics: > unset xtics; set xtics auto
可以使用 set 命令自定义的其他功能包括:箭头、边框、剪辑、轮廓、网格、映射、极坐标、表面、时间、视图等等。
用其他注释字符绘制数据文件
如果您的数据文件有 # 以外的注释字符,您可以告诉 Gnuplot。
例如,如果您的数据文件有“%”注释字符(为了 Matlab 兼容性),键入
gnuplot> set datafile commentschars "#%"
表示“#”或“%”字符开始注释。
GNUPLOT SCRIPTS
为了简化您的绘图操作,可以将几个 Gnuplot 命令组合到一个脚本文件中
【gnuplot】gnuplot安装与简易使用相关推荐
- win10下gnuplot的安装
win10下gnuplot的安装 gnuplot介绍 Gnuplot是一个命令行的交互式绘图工具(command-driven interactive function plotting progra ...
- Gnuplot的安装和基本使用方法
Gnuplot的安装和基本使用方法 参考文献: https://blog.csdn.net/weixin_42014622/article/details/82962634
- linux 安装docker简易方法
linux 安装docker简易方法,以Ubuntu为例 原因 新的安装方式 把问题抛给docker官网 安装docker-compose 原因 之前安装 需要多行命令 sudo apt update ...
- win10下gnuplot的安装和使用
gnuplot介绍 Gnuplot是一个命令行的交互式绘图工具(command-driven interactive function plotting program).用户通过输入命令,可以逐步设 ...
- WIN10下gnuplot 的安装
文章目录 安装地址 安装 使用 安装地址 https://sourceforge.net/projects/gnuplot/ 记得点开下面的文件选择版本,直接点下载的文档win10没法安装. 不是这个 ...
- matlab gnuplot,Gnuplot 64位版(gnuplot颜色渲染)V5.2.3 安装版
Gnuplot 64位版(gnuplot颜色渲染)是一款功能强大的命令行的交互式科学绘图工具.Gnuplot 64位版能够将高等函数运算进行图像化,让那个函数的变化更加的直观并且能够通过对图像的移动变 ...
- gnuplot下载安装使用
一.介绍gnuplot及下载 Gnuplot支持多种类型地块在任何2D和3D.它可以通过绘制线,点,箱,等高线,矢量场,表面和各种相关文字.它也支持各种专业绘图类型. Gnuplot支持多种不同类型输 ...
- linux下运行gnuplot,Gnuplot Linux版下载
Gnuplot Linux版是款可以在Linux系统上运行的绘图软件.它可以根据用户输入的命令行精准的绘制出各种图形,操作简单,非常实用,有喜欢的用户不要错过了. [主要功能] 1.坐标: xyz轴的 ...
- Dell 755 安装PCI 简易通讯控制器驱 WIN2K3 驱动
Optiplex 755 安装完win2003后默认驱动会多出两个未知设备"PCI简易通讯控制器"和"PCI串行口",官方上说明需要加载HECI和SOL/LMS ...
最新文章
- 大数据中台之Kafka,到底好在哪里?
- 股权分配中的三种定时炸弹
- centos 管道符取第一行_Linux用户组管理及用户权限及管道符应用
- 线性回归 c语言实现_C ++中的线性回归实现
- 自学python(一)
- 初二物理模型有哪些_初二是成绩下滑的高危期,做好这5点成绩涨涨涨!(附全学科提升技巧,家长转给孩子!)...
- Ubuntu15.10使用mysql
- restfull api 接口 规范
- 别怀疑,孩子在家里也能学编程!
- Java声明字符串数组,架构师必备!
- 上位机与1200组态步骤_图解组态王一组态王软件
- 【纪中集训2019.3.25】礼物
- 微信小程序车牌号输入组件(虚拟键盘)
- (Inside Out)Web地图坐标系——谷歌的无奈
- SQL数据库学习总结(一)
- 0001 工作业务问题_滞纳金公式计算区别实例
- 《黑色沙漠》游戏分析与拆解
- Linux系统介绍:内核、shell及软件包管理
- 视觉学习笔记Week9 Gazebo仿真环境下相机焦距计算
- 批处理登陆邮箱代码分析
热门文章
- mysql 实现异地同步_MySQL 异地同步问题
- Android水印相机
- 虚幻C++入门个人笔记(3)——接口、智能指针、动画蓝图、行为树、EQS系统
- Android 华为手机获取相册图片路径,获取不到问题
- excel 制作好看的图表
- win11恢复win10的右击菜单,自测可用
- mfc改计算机名称,VC获取并修改计算机屏幕分辨率(MFC)
- Dialog中显示倒计时,到时自己主动关闭
- 电商大数据应用之用户画像
- 旧电脑改路由器加文件服务器,如何将旧电脑改成软路由器 以winxp系统为例