2

hoping this question is an easy one to solve!

I am trying to create an intensity map of a set of values. Each value has a corresponding (x,y) coordinate. Currently, my data is in the form of 3 separate arrays all of the same length. One array has x-coordinates, another has y-coordinates, and the third has numerical values that are the intensities i wish to colorize. Really I'm thinking this is just a scatter plot but integrating the third array's value into a color. If anyone knows which plotting method I should use that would be great. I've tried pcolor from pyplot, but it is giving me errors about the dimensions of my x and y data. Maybe this is an issue with the x and y arrays being 1-d?

Thanks in advance for any help!

1 Answer 1

5

Figured it out! Just need to set the value array to a color variable. Like this:

    plt.scatter(x, y, c=z, cmap='jet',vmin=0, vmax=250)
    plt.colorbar()
    plt.show()

"z" is the values array!

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

1 Comment

Hello, Can you share your code, I am working on a similar thing. Thanks.

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.