'Plotting a condition function in three dimensional space with Python
Problem: I want to plot a two varibles condition function f(x,y) on three dimesional space and here is my code
from matplotlib import pyplot as plt
import numpy as np
x = np.linspace(0, 10, 200)
y = np.linspace(0, 10, 200)
if (0<y**2) == True and (y**2<x) == True:
z = 3/4
elif (y == 0) == True or (0<=x<=y**2) == True:
z = 0
plt.plot(x,y,z)
I type this code on Google Colab and it send me an error at line 3 as following
The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
