Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Free space loss 3D Plot
#2
I proceeded a bit and got the following code but there is still an error 'only size-1 arrays can be converted to Python scalars'. What's wrong with my code?

import math
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
ax = plt.axes(projection='3d')

def function(d, f):
    x = 4*math.pi
    ls = 3*10**8
    test = 20*math.log10(d)+20*math.log10(f)+20*math.log10(x/ls)
    return test

x = np.linspace(0,10, 100)
y = np.linspace(0,10, 100)

X,Y = np.meshgrid(x,y)
Z = function(X,Y)

ax.plot_surface(X,Y,Z)
plt.show()
Reply


Messages In This Thread
Free space loss 3D Plot - by scimi - Sep-25-2020, 12:31 PM
RE: Free space loss 3D Plot - by scimi - Sep-25-2020, 01:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Win or Loss Prediction ksasi2k3 4 493 Apr-25-2024, 01:46 PM
Last Post: ksasi2k3
  How to plot intraday data of several days in one plot mistermister 3 3,055 Dec-15-2020, 07:43 PM
Last Post: deanhystad
  from global space to local space Skaperen 4 2,420 Sep-08-2020, 04:59 PM
Last Post: Skaperen
  How to plot vertically stacked plot with same x-axis and SriMekala 0 1,995 Jun-12-2019, 03:31 PM
Last Post: SriMekala

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020