Search code examples
javaimagej

Adding legend to plot in ImageJ


I'm a bit stuck in a small problem with ImageJ plots. I need to add a simple legend. I have two lines (one is red and the other one is blue) and I want to add a sidenote that explains that line red is function "a" and line blue is function "b", but i can't understand how to use addLegend method in Plot class. Can you help me? An example would be very useful.


Solution

  • Ok, I get it.

        plot.addLegend("A\nB");