sciapp / gr

GR framework: a graphics library for visualisation applications
Other
329 stars 54 forks source link

shadepoints value counts array #70

Open lazarusA opened 5 years ago

lazarusA commented 5 years ago

How do get the value count for each pixel (array) when I call the function shadepoints (or shade)?

lazarusA commented 5 years ago

Also, if you have shade(x, y, xform=GR.XFORM_EQUALIZED, colormap=-GR.COLORMAP_HOT, xlim=(-4,4), ylim=(-3,3)); how do I remove the axis (something like axis = false?) ?

jheinen commented 5 years ago

A1: There is currently no function to obtain the value count.

A2: There is no axis atttribute, but you can bypass the convenience shade function and call the shadepoints function directly (using low-level primitives), e.g.:

clearws()
setcolormap(-GR.COLORMAP_HOT)
setviewport(0, 1, 0, 1)
xmin, xmax = extrema(x)
ymin, ymax = extrema(y)
setwindow(xmin, xmax, ymin, ymax);
shadepoints(x, y, xform=GR.XFORM_EQUALIZED)
updatews()
lazarusA commented 5 years ago

A1. Any plans to have one? For real work, doing statistical analysis, it will be really helpful. A2. Thanks!

jheinen commented 5 years ago

I'll check this. Is probably useful for (future) hover effects, too