OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Three array scatter plot using Numpy and Matplotlib

  • Thread starter Thread starter KAVSHEKAA V CSBS
  • Start date Start date
K

KAVSHEKAA V CSBS

Guest
Code:
import matplotlib.pyplot as plt
 
x =[24,73,94,8,26,80,89,23,7,50] 
 
y =[52,98,48,39,50,84,76,96,76,9]

z=[14,56,79,21,42,67,5,55,27,91,10]
 
plt.scatter(x, y,z)
 
# To show the plot
plt.show()

I can only give 2 arrays in order to get a scatter plot. What should I do in order to get the 3 array in a single scatter plot without converting into a 3d array plotting.

I also tried the below code but it is not possible.

Code:
import matplotlib.pyplot as plt
import numpy as np
x =np.array[24,73,94,8,26,80,89,23,7,50] 
 
y =np.array[52,98,48,39,50,84,76,96,76,9]

z=np.array[14,56,79,21,42,67,5,55,27,91,10]
 
plt.scatter(x, y,z)
 
# To show the plot
plt.show()
<pre><code>import matplotlib.pyplot as plt

x =[24,73,94,8,26,80,89,23,7,50]

y =[52,98,48,39,50,84,76,96,76,9]

z=[14,56,79,21,42,67,5,55,27,91,10]

plt.scatter(x, y,z)

# To show the plot
plt.show()
</code></pre>
<p>I can only give 2 arrays in order to get a scatter plot. What should I do in order to get the 3 array in a single scatter plot without converting into a 3d array plotting.</p>
<p>I also tried the below code but it is not possible.</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
x =np.array[24,73,94,8,26,80,89,23,7,50]

y =np.array[52,98,48,39,50,84,76,96,76,9]

z=np.array[14,56,79,21,42,67,5,55,27,91,10]

plt.scatter(x, y,z)

# To show the plot
plt.show()
</code></pre>
 

Latest posts

S
Replies
0
Views
1
Safwan Aipuram
S
Top