Answer the question
In order to leave comments, you need to log in
How to call a function based on two functions?
There are several functions. The first one forms the first array, the second one forms the second array. In the third, these arrays are multiplied, a new third array is obtained. And as soon as, in the fourth function, I want to plot the dependence of the first array on the third, problems begin.
The code is schematically like this:
def getarray1():
#Получаю первый массив
return array1
def getarray2():
#Получаю второй массив
return array2
def getarray3(array1, array2):
#Перемножаю элементы первого и второго массивов,
#получаю третий массив.
return array3
def buildgraph(array1, array3):
plt.plot(array1, array3)
plt.xlabel('x')
plt.ylabel('y')
plt.title('Title name')
plt.savefig("test.png")
plt.show()
getarray3(getarray1(), getarray2())
buildgraph(getarray1(), getarray3())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question