我对Python中的图形不是很了解。有没有可能创建一个由我个人算法生成的图形?
我想创建图形,但不使用库的计算函数。例如,我看到要在Scipy
中创建图形,必须首先使用它提供的计算函数,然后计算结果以图形表示。
我想创建一个我的不同My_Customs
的绘图,使用Matplotlib
的plt.bar
,其中一些酒吧是红色的,一些是绿色。与标签下的每个酒吧
我如何用图表来表示这一点?(我接受任何书店)
#Green Color
My_Custom_1 = ((1.54 ** 1) * 2.7182818284 ** (-1.54)) / 1 * 100
My_Custom_2 = ((1.54 ** 2) * 2.7182818284 ** (-1.54)) / 2 * 100
My_Custom_3 = ((1.54 ** 3) * 2.7182818284 ** (-1.54)) / 6 * 100
#Red color
My_Custom_0 = ((1.54 ** 0) * 2.7182818284 ** (-1.54)) / 1 * 100
My_Custom_4 = ((1.54 ** 4) * 2.7182818284 ** (-1.54)) / 24 * 100
字符串
我已经创建了一个小软件,它已经执行了计算并将结果返回给我。我不想使用函数来计算泊松。我想直接将各种My_Customs的结果用于图形中。
我画了我想找的东西:
2条答案
按热度按时间kqlmhetl1#
“不使用库计算函数”是一个反目标。你至少应该使用Numpy,而不是重复计算。你使用
matplotlib
的事实意味着你已经安装了numpy。除此之外,如果您希望条形图标签与绘图中所描绘的一样,
字符串
的数据
hwamh0ep2#
也许你的意思是这样的:
的数据
字符串