Skip to content

Instantly share code, notes, and snippets.

@edy555
Created March 30, 2013 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edy555/5275017 to your computer and use it in GitHub Desktop.
Save edy555/5275017 to your computer and use it in GitHub Desktop.
matplotlibによるVNA測定結果の3D表示
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
f,arg,mag,ref = np.loadtxt('vnaplot.dat', delimiter=' ', unpack=True)
mpl.rcParams['legend.fontsize'] = 10
fig = plt.figure()
ax = fig.gca(projection='3d')
r = 10**mag
y = r * np.cos(arg)
z = r * np.sin(arg)
ax.plot(f, y, z, label='magnitude')
ax.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment