How to plot spectrum without wide histogram bins on zooming?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
NoviceGeek
Posts: 1
Joined: Wed Jun 15, 2016 4:40 pm
antibot: No, of course not.

How to plot spectrum without wide histogram bins on zooming?

Post by NoviceGeek » Wed Jun 15, 2016 4:48 pm

Hi,
I want to represent a mass spectrum (m/z and intensity) in the form of a plot. I am using the following code, which used the `createHistogram` method to generate the plot:

Code: Select all

 spectrumPlot = ChartFactory.createHistogram(node.toString(),
                    "m/z", "Intensity", dataset1, PlotOrientation.VERTICAL, false, false, false); 
I get the correct plot, but when I zoom-in the width of the histogram bars also increases. And, due to this, the bars appear to be spanning a specific width (whereas it should be a single 1 point line). This is how the plot looks at the moment:

Image

And, I want it to look something like this:

Image

So, just single vertical bars even if the plot is zoomed. How can I do this?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: How to plot spectrum without wide histogram bins on zoom

Post by paradoxoff » Wed Jun 15, 2016 6:44 pm

Use a different renderer.
See this thread for an example.

Locked