How to get pixel value from a color map?

  • #1
69
0

Main Question or Discussion Point

I have a python code where it generates two 1D arrays, plots them using scatter plot and then draws colorbar using normalization range. How can I find individual values at those individual pixel points?

Python:
HC = data["HC"]
OC  = data["OC"]
sample = y
widthmm, heightmm = 171, 233
ratio = (widthmm/2.0)/(heightmm/4.0)
widthinch = widthmm/25.40
fig = plt.figure(figsize=(widthinch,widthinch/ratio))
ax1 = fig.add_subplot(111)
ax1 = plt.hexbin(OC,HC,cmap=glocmap,bins=None,gridsize=(20,15),alpha=0.75,mincnt=1,vmax=50,linewidth=0,vmin=7)

CvarLab = 0
cb = plt.colorbar(ax1)
cb.set_label(CvarLab,size=20)
cb.ax.tick_params(labelsize=20)
cb.set_alpha(1)
cb.draw_all()
and it generates a plot like this .My question is how can I find values of 'Mass' on those individual points shown in image given than we have only two 1 dimensional arrays?
 

Answers and Replies

  • #2
11,495
5,033
What is it you're wanting to do? is it to show the mass values on the plot? or to get the colors the mass values were assigned?
 
  • #3
69
0
What is it you're wanting to do? is it to show the mass values on the plot? or to get the colors the mass values were assigned?
I want to get mass values at those individual points on the plot.
 

Related Threads on How to get pixel value from a color map?

Replies
4
Views
9K
Replies
8
Views
1K
Replies
5
Views
12K
  • Last Post
Replies
2
Views
8K
Replies
19
Views
807
Replies
7
Views
148K
Replies
5
Views
984
  • Last Post
Replies
2
Views
2K
Replies
2
Views
993
  • Last Post
Replies
1
Views
1K
Top