0

I need to convert a grid of values into a density plot to make a picture that shows the structure of the silicon surface that was scanned. The file of values is called stm.txt and can be found here: http://www-personal.umich.edu/~mejn/cp/programs.html

I really can't figure this one out so I'm in some real need of help.

1 Answer 1

1

You can use numpy's loadtxt (https://docs.scipy.org/doc/numpy-1.10.4/reference/generated/numpy.loadtxt.html) to load your data, and then imshow (https://matplotlib.org/api/_as_gen/matplotlib.pyplot.imshow.html).

import numpy as np
import matplotlib.pyplot as plt

grid = np.loadtxt("stm.txt")
plt.imshow(grid)
plt.show()

Density plot of stm.txt

Sign up to request clarification or add additional context in comments.

2 Comments

@BrandonSeedlessBananasMc-Wil: If this answers the question, please accept it as the answer.
Sorry, how do I do that? I'm new to this site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.