Click here to Skip to main content
15,064,140 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to create a 3D contour data cube using Python. I have 200 files of data which consists of 200 rows and 200 columns of data in each file. I wanted to create a 3d contour data cube with the x-axis as the row, the y-axis as the column, and the z-axis as the combine for all 200 files. Is it possible? Below is the coding I used to create a 2D contour plot.

What I have tried:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

a = 0
df = pd.read_csv(r"FRD " + str(a) + ".tas", delim_whitespace=True)
data = np.asmatrix(df)

x = [x for x in range(0, len(df.columns))]
y = [x for x in range(0, len(df.iloc[:, 1]))]
x, y = np.meshgrid(x,y)

cp = plt.contourf(x,y,df)
Updated 16-Feb-21 23:53pm

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900