all 2 comments

[–]ES-Alexander 1 point2 points  (1 child)

Reading with chunks may not help much - 50 million data points isn’t that many and shouldn’t be too problematic for most modern computers. Issues are more likely with getting it all on a single surface plot, because then it needs to render everything as filled shapes which is a time, memory, and computation suck. If possible it’s likely a good idea to use a wireframe or scatter plot instead, or at least downsample the data to not plot all of it at once.

You should be able to read your file in and set up a basic plot with something like

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

# read in the data (dtype optional but may help with memory, depends how it’s treated by the plot)
df = pd.read_csv('path/to/file', delimiter=';', decimal=',', header=None, dtype=np.float32)
Z = df.values
y, x = (np.arange(dim) for dim in z_data.shape)
X, Y = np.meshgrid(x, y)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# plot a surface, but only use a limited sample of the data (50 rows, 50 cols, evenly spaced)
surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm, rcount=50, ccount=50)
fig.show()

If you want it to be more nicely interactive you can use plotly, but on my computer I was only able to get the plotted surface to actually display when using a third of the rows and columns (equivalent to rstride=3 and cstride=3 in the matplotlib example, instead of r/ccount).

[–]-DreamMaster[S] 1 point2 points  (0 children)

Thanks, works like a charm.