Reputation: 4470
I am adding an annotation to my plot, but I can't work out how to change the colour or line width (stroke) of this. I've read through the documentation as best as I can but I'm out of ideas. Can anyone help?
Shape shape = new Ellipse2D.Double(circleXValue - radius, circleYValue - radius, radius + radius, radius + radius);
XYShapeAnnotation annotation = new XYShapeAnnotation(shape);
// ??
plot.addAnnotation(annotation);
Upvotes: 1
Views: 1719
Reputation: 205775
You can find related examples using XYShapeAnnotation
here and here.
Upvotes: 3
Reputation: 514
You're using this constructor:
public XYShapeAnnotation(java.awt.Shape shape)
You may want to use one of these constructors that specify additional parameters:
public XYShapeAnnotation(
java.awt.Shape shape,
java.awt.Stroke stroke,
java.awt.Paint outlinePaint)
public XYShapeAnnotation(
java.awt.Shape shape,
java.awt.Stroke stroke,
java.awt.Paint outlinePaint,
java.awt.Paint fillPaint)
Upvotes: 3