Histogram in ImageJ

Hi there
I have got a list of frequency of pixel values(0-4,5-9 …) from an image. How should I use it to generate histogram?
Thanks

Hi @YYaosy and welcome to the forum!

sorry for the delayed response to your post here. You can make use of the ij.gui.Plot class in ImageJ to create a plot, add some data, and finally show it in a plot window, as illustrated in this little Groovy script (run it from the script editor after selecting Language > Groovy):

import ij.gui.Plot

values = [123, 42, 23, 5, 4, 2, 3, 1, 0, 0, 1]

p = new Plot("Custom Histogram", "Pixel value", "Counts")

p.add("bar", (0..values.size*5).step(5) as double[], values as double[])
p.show()

(since you didn’t provide any example data, I had to make up some values…)

Hope that helps.

image