From 1abad5fe49d6b0d10dd8ded6041e81a33f2c7f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E6=B5=AA=E7=86=8A=E7=8C=AB=E5=84=BF?= Date: Sat, 23 Nov 2024 02:17:56 +0000 Subject: [PATCH] =?UTF-8?q?!52=20Gnuplot=EF=BC=9A=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E5=B9=B3=E9=9D=A2=E7=9B=B4=E8=A7=92=E5=9D=90=E6=A0=87=E7=B3=BB?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/gnuplot_cartesion.zh.tmu | 261 +++++++++++++++++++++++++++++ templates/index.zh.tmu | 26 ++- 2 files changed, 284 insertions(+), 3 deletions(-) create mode 100644 templates/gnuplot_cartesion.zh.tmu diff --git a/templates/gnuplot_cartesion.zh.tmu b/templates/gnuplot_cartesion.zh.tmu new file mode 100644 index 0000000..0625b10 --- /dev/null +++ b/templates/gnuplot_cartesion.zh.tmu @@ -0,0 +1,261 @@ +> + +> + +<\body> + 本模板的目的是方便大家使用Gnuplot绘制常用的平面直角坐标系的曲线: + + <\wide-tabular> + || + > + |<\cell> + + |<\cell> + + >| + <\session|gnuplot|default> + <\unfolded-io> + png]\ + <|unfolded-io> + % -width 0.27par + + \; + + plot sin(x) + <|unfolded-io> + |png>|0.27par|||> + + + |<\cell> + <\session|gnuplot|default> + <\unfolded-io> + png]\ + <|unfolded-io> + % -width 0.27par + + set xtics pi; set ytics 1 + + plot sin(x) + <|unfolded-io> + |png>|0.27par|||> + + + |<\cell> + <\session|gnuplot|default> + <\unfolded-io> + png]\ + <|unfolded-io> + % -width 0.27par + + set xtics pi; set ytics 1 + + plot [-pi:pi] sin(x) + <|unfolded-io> + |png>|0.27par|||> + + + + \; + >| + 第一行开头的语法是特殊语法,用于控制Gnuplot生成的图片在墨干中的大小 + |<\cell> + xtics和ytics用于控制横轴和纵轴的刻度 + |<\cell> + 在plot的同时设置横轴的范围 + >| + \; + |<\cell> + \; + |<\cell> + \; + >| + + |<\cell> + + |<\cell> + + >| + <\session|gnuplot|default> + <\unfolded-io> + png]\ + <|unfolded-io> + % -width 0.27par + + xmin=0; xmax=6.5 + + ymin=-1.2; ymax=1.2 + + xgap=pi; ygap=1 + + f(x)=sin(x); g(x)=cos(x) + + \; + + set xtics xgap + + set ytics ygap + + set xrange [xmin: xmax] + + set yrange [ymin: ymax] + + \; + + plot f(x), g(x) + <|unfolded-io> + |png>|0.27par|||> + + + + 右边,为了绘制教科书上常见的样式,第二部分做了如下改进: + + <\enumerate> + 取消边框 + + 设置过原点的坐标轴 + + 设置横轴和纵轴的刻度 + + 设置横轴和纵轴的箭头 + + 设置横轴和纵轴的范围 + + + 大家只需要复制代码片段,更改第一部分的预设的值和函数,更改最后一部分的plot绘制命令即可。 + |<\cell> + <\session|gnuplot|default> + <\unfolded-io> + png]\ + <|unfolded-io> + % -width 0.27par + + xmin=-6.5; xmax=7 + + ymin=-1.2; ymax=1.2 + + xgap=pi; ygap= 0.5 + + f(x)=sin(x) + + g(x)=cos(x) + + \; + + unset border + + set zeroaxis linetype -1 linewidth 1.7 + + set xtics axis + + set ytics axis + + set xtics xgap + + set ytics ygap + + set arrow from xmin,0 to xmax,0 + + set arrow from 0,ymin to 0,ymax + + set xrange [xmin:xmax] + + set yrange [ymin:ymax] + + \; + + plot f(x),g(x) + <|unfolded-io> + |png>|0.27par|||> + + + + 右边,当我们将椭圆方程 |4>+|9>=1> 视为函数 =|4>+|9>-1> 时,这个函数在 =0> 时描述的就是椭圆的边界。通过绘制这个函数的等高线,并且只选择 =0> 这一特定的等高线,我们就可以得到椭圆的图形。 + |<\cell> + <\session|gnuplot|default> + <\unfolded-io> + png]\ + <|unfolded-io> + % -width 0.27par + + xmin=-3; xmax=3.5 + + ymin=-4; ymax=4.5 + + xgap=1; ygap=1 + + f(x,y)=x**2/4 + y**2/9 - 1 + + \ \ + + set contour base + + unset surface + + set view map + + set isosamples 100, 100 + + set cntrparam levels discrete 0 + + unset xtics + + unset ytics + + \; + + unset border + + set zeroaxis linetype -1 linewidth 2 + + set xtics axis + + set ytics axis + + set xtics xgap + + set ytics ygap + + set arrow from xmin,0 to xmax,0 + + set arrow from 0,ymin to 0,ymax + + set xrange [xmin:xmax] + + set yrange [ymin:ymax] + + \; + + splot f(x,y) + <|unfolded-io> + |png>|0.27par|||> + + + >>> + + + \; + + +<\initial> + <\collection> + + + + +<\references> + <\collection> + > + > + > + + + +<\auxiliary> + <\collection> + <\associate|toc> + |绘制sin(x) |.>>>>|> > + + |设定x轴和y轴的刻度的间隔 |.>>>>|> > + + + diff --git a/templates/index.zh.tmu b/templates/index.zh.tmu index 87760a9..cab57da 100644 --- a/templates/index.zh.tmu +++ b/templates/index.zh.tmu @@ -1,12 +1,16 @@ -> +> > <\body> + <\hide-preamble> + > + + > <\wide-tabular> - ||||| + ||||| 名称 |<\cell> 类别 @@ -14,6 +18,8 @@ 作者 |<\cell> 版本 + |<\cell> + 墨干版本 |<\cell> 版权 >| @@ -21,9 +27,23 @@ |<\cell> 简历模板 |<\cell> - LiiiLabs + |<\cell> 20241014 + |<\cell> + \v1.2.9.5 + |<\cell> + 公共领域 + >| + + |<\cell> + 绘图模板 + |<\cell> + + |<\cell> + 20241123 + |<\cell> + \v1.2.9.7 |<\cell> 公共领域 >>>