In relation to the topic :Using matplotlib Polycollection to plot data from csv files . I wanted to make my plot but with log space data from the x axis!
I made this:
import matplotlib.pyplot as plt
from matplotlib.collections import PolyCollection
from mpl_toolkits.mplot3d import axes3d
import numpy as np
data1=eval(input())
freq_data = np.logspace(-15,15,500)[:,None]*np.ones(10)[None,:]
amp_data = data1
rad_data = np.array([1,2,3,4,5,6,7,8,9,10])
verts = []
for irad in range(len(rad_data)):
xs = np.concatenate([[freq_data[0,irad]], freq_data[:,irad], [freq_data[-1,irad]]])
ys = np.concatenate([[0],amp_data[:,irad],[0]])
verts.append(list(zip(xs, ys)))
poly = PolyCollection(verts)
poly.set_alpha(0.7)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# The zdir keyword makes it plot the "z" vertex dimension (radius)
# along the y axis. The zs keyword sets each polygon at the
# correct radius value.
ax.add_collection3d(poly, zs=rad_data, zdir='y')
ax.set_xlabel('symlog')
ax.set_xlim(freq_data.min(), freq_data.max())
ax.set_xlabel('Frequency')
ax.set_ylim(rad_data.min(), rad_data.max())
ax.set_ylabel('Radius')
ax.set_zlim(amp_data.min(), amp_data.max())
ax.set_zlabel('Amplitude')
plt.show()
but still i cannot get what i want. So i want to plot the data versus the frequency and the frequency is log spaced.
Attached is my input data: https://www.dropbox.com/s/63gs0n365mal3t6/test_data.mat?dl=0 you can downloaded and input it to the program.
Note: I have tried with random data instead of input and it did gave a proper plot. So please if you want to test the code do it with data attached.