gnuplot:绘制带有点坐标复杂分析的图

时间:2019-02-21 20:23:41

标签: function plot graph gnuplot

告诉我PLZ如何绘制图形以便可以操纵y坐标?

例如:

之前

function func(y)
{
    return y * 3.14 + y * y / 1000;
}

plot inputFullPath using 1:my_func(2) with lines ls 3 notitle

之后:

import random

money = input('Total money: ')
mi = int(money)

Food = ['Taco', 'Burrito', 'Nacho']
Price = [6, 4, 2]
List = {f:p for (f, p) in zip(Food, Price)}

RandomFood = random.sample(Food, 1)
RFS = RandomFood[0]

while mi >= 0:
    cost = List[RFS]
    mi = mi - cost

1 个答案:

答案 0 :(得分:2)

my_func(y) = y * pi + y*y / 1000.
plot inputFullPath using 1:(my_func($2)) with lines

请注意,“ pi”是一个预定义的变量,最安全的方法是将小数点放在浮点常量之后