我们如何使用不同的线条样式(例如破折号、点划线等,而不仅仅是更改线条的颜色)绘制最大值。最小工作示例:
f(x) := sin(x) $
g(x) := cos(x) $
plot2d( [f(x), g(x)], [x,0,10],
[style, [lines, 1,4], [lines, 1,3]] )$
Run Code Online (Sandbox Code Playgroud)
style上述操作可能可以通过的选项来完成plot2d。但是,我找不到正确的选择。
一种方法是在 中设置线型gnuplot_preamble。
f(x) := sin(x) $
g(x) := cos(x) $
p: "set linetype 1 dashtype '-'
set linetype 2 dashtype '.'" $
plot2d(
[f('x), g('x)], ['x, 0, 10],
['gnuplot_preamble, p],
['style, ['lines, 4, 4], ['lines, 4, 3]])$
Run Code Online (Sandbox Code Playgroud)