我们如何绘制具有不同线条样式的最大值(例如破折号,破折点等),而不仅仅是改变线条的颜色)。 最小的工作示例:
f(x) := sin(x) $
g(x) := cos(x) $
plot2d( [f(x), g(x)], [x,0,10],
[style, [lines, 1,4], [lines, 1,3]] )$
以上可能可以通过style
的{{1}}选项来完成。但是,我找不到正确的选项。
答案 0 :(得分:4)
一种方法是在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]])$
答案 1 :(得分:3)
您也可以 使用draw
而不是plot
。示例:
f(x) := sin(x) $
g(x) := cos(x) $
draw2d(line_type=dashes, explicit(f(x),x,0,10), color=red, explicit(g(x),x,0,10));
在帮助中查找draw
和line_type