XYPlot blurry ...

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Nick_000
Posts: 2
Joined: Sat Jul 09, 2016 4:20 am
antibot: No, of course not.

XYPlot blurry ...

Post by Nick_000 » Sat Jul 09, 2016 4:25 am

Hello, I am using JFreeChart to generate mass spectrum, there are only vertical lines, and hundreds lines in one plot, however I found that some lines are blurry, I was trying to use plot.setShadowGenerator(null), but it didn't work, and I also tried

Code: Select all

XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
        for (int i=0; i<seriesCount; i++){
            renderer.setBaseShapesVisible(false);
            renderer.setBaseShapesFilled(true);
            renderer.setSeriesStroke(i, new BasicStroke(1));
            
        }
still didn't work... I was wondering if there was any way to make each line 1px without blurry edge, thank you!

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: XYPlot blurry ...

Post by John Matthews » Sun Jul 10, 2016 2:25 am

If you're rendering with ChartUtilities, consider what image type to use.

Nick_000
Posts: 2
Joined: Sat Jul 09, 2016 4:20 am
antibot: No, of course not.

Re: XYPlot blurry ...

Post by Nick_000 » Sun Jul 10, 2016 5:42 pm

John Matthews wrote:If you're rendering with ChartUtilities, consider what image type to use.
I did't use ChartUtilities to render and generate a pic, I just display the plot on a panel, but the some lines are blurry, and some line is only a single line...
https://postimg.org/image/hbnwffa2v/
I was wondering if there is any way to solve this problem, thank you!

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: XYPlot blurry ...

Post by John Matthews » Sun Jul 10, 2016 8:23 pm

Override getPreferredSize on the panel and return a suitable size.

Locked