gnuplot使用2
设置图中连线的颜色、宽度、连线样式等
set style line
每个显示终端都有默认的线类型和点类型集合,可以通过在命令行输入: test查看,如下图显示了在wxt终端模式下默认的线的集合和点的集合
set style line命令定义了一组线的类型和宽度及点的类型集合,方便后面通过索引号来调用,而不用每次都输入一遍set style line命令来设置。
Syntax:
set style line <index> default set style line <index> {{linetype | lt} <line_type> | <colorspec>} {{linecolor | lc} <colorspec>} {{linewidth | lw} <line_width>} {{pointtype | pt} <point_type>} {{pointsize | ps} <point_size>} {{pointinterval | pi} <interval>} {palette} unset style line show style line
default 参数设置具有相同索引号的线风格为默认值,如set style line 5 default意思是设置索引号为5的线的风格为 默认的风格
线的风格包括:
1、线的类型linetype简写为lt,默认的linetype如下图
2、线的颜色:linecolor简写为lc,后面跟的值为:
where <colorspec> has one of the following forms:
rgbcolor "colorname" # e.g. "blue" rgbcolor "0xRRGGBB" # string containing hexadecimal constant rgbcolor "0xAARRGGBB" # string containing hexadecimal constant rgbcolor "#RRGGBB" # string containing hexadecimal in x11 format rgbcolor "#AARRGGBB" # string containing hexadecimal in x11 format rgbcolor <integer val> # integer value representing AARRGGBB rgbcolor variable # integer value is read from input file palette frac <val> # <val> runs from 0 to 1 palette cb <value> # <val> lies within cbrange palette z variable # color index is read from input file bgnd # background color black
3、线的宽度:linewidth、点的风格:pointtype、pointsize等同样的道理,可以查询具体的可选值
例如:在命令行输入 plot 'datafile.dat' w linespoint ,显示如下图
输入: plot 'datafile.dat' w linespoint lt 2表示使用2号linetype线型,显示如下图
该图显示的是默认的linetype 2的风格,如果想改变线的颜色,则可以在命令后面继续跟上lc ‘red’
在命令行提示符后面输入:plot 'datafile.dat' w linespoint lt 2 lc 'red',则lc参数覆盖了默认lt显示线的颜色,如下图
当然也可以改变线的宽度、点的类型等
输入:plot 'datafile.dat' w linespoint lt 2 lc 'red' lw 2 pt 3
可以看到线的宽度、点的类型都变了,其他想设置什么自己练练吧
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
2015-08-29 $root knockout