-
Notifications
You must be signed in to change notification settings - Fork 33
howto point size
Erich Seifert edited this page Sep 21, 2017
·
2 revisions
Usually the size of data points on a plot is defined by the Shape object which is used by the PointRenderer. The default shape is a rectangle which is 5 units (= pixels) wide and 5 units high. There are two ways to get a shape of a different size:
You can define a completely new shape:
PointRenderer pointRenderer = plot.getPointRenderers(data).get(0);
// Create a new rectangle which is 10 units wide and 20 units high
Shape newShape = new Rectangle.Double(-5.0, -10.0, 10.0, 20.0);
pointRenderer.setShape(newShape);You can scale the current shape:
PointRenderer pointRenderer = plot.getPointRenderers(data).get(0);
Shape oldShape = pointRenderer.getShape();
// Get a new shape that is twice as large
Shape newShape = AffineTransform.getScaleInstance(2.0, 2.0).createTransformedShape(oldShape);
pointRenderer.setShape(newShape);