Created
July 3, 2015 16:15
-
-
Save leelasd/d8640b4633cdb11074a6 to your computer and use it in GitHub Desktop.
Data as a function of time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from mpl_toolkits.mplot3d import Axes3D | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
dat=pd.read_csv("Gban_data.csv") | |
def randrange(n, vmin, vmax): | |
return (vmax-vmin)*np.random.rand(n) + vmin | |
fig = plt.figure() | |
ax = fig.add_subplot(111, projection='3d') | |
x=dat.Field | |
y1=dat.Intensity1;z1=0 | |
y2=dat.Intensity2;z2=10 | |
y3=dat.Intensity3;z3=20 | |
### Un comment below 3 lines if you want plot with points not with lines | |
#ax.scatter(x,[0]*len(dat.Field) ,y1, c='r', marker='^') | |
#ax.scatter(x,[10]*len(dat.Field),y2 , c='g', marker='o') | |
#ax.scatter(x,[20]*len(dat.Field),y3 , c='b', marker='*') | |
ax.plot(x,[z1]*len(dat.Field) ,y1, c='r' ) | |
ax.plot(x,[z2]*len(dat.Field),y2 , c='g' ) | |
ax.plot(x,[z3]*len(dat.Field),y3 , c='b' ) | |
ax.set_xlabel('Field') | |
ax.set_ylabel('Time ') | |
ax.set_zlabel('Intensity') | |
plt.savefig('example01.pdf') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment