gpt4 book ai didi

plot - 带虚线的最大值图

转载 作者:行者123 更新时间:2023-12-01 09:43:43 27 4
gpt4 key购买 nike

我们如何以不同的线型(例如虚线、点划线等而不只是改变线的颜色)绘制最大值。最小的工作示例:

f(x) := sin(x) $
g(x) := cos(x) $
plot2d( [f(x), g(x)], [x,0,10],
[style, [lines, 1,4], [lines, 1,3]] )$

以上可能可以通过 plot2dstyle 选项来完成。但是,我找不到合适的选项。

最佳答案

一种方法是在 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]])$

enter image description here

关于plot - 带虚线的最大值图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53782066/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com