gpt4 book ai didi

java - 改变 XYPlot 系列点的形状

转载 作者:行者123 更新时间:2023-11-30 08:05:02 26 4
gpt4 key购买 nike

我想将点的形状设置为圆形。我是这样做的:

Shape shape  = new Ellipse2D.Double(-5,-5,5,5);
renderer.setSeriesShape(0, shape);

然后我得到以下结果:

enter image description here

圆圈略有偏移。我试图更改 (-5,-5,5,5) 以便根据该行使圆居中,但没有任何效果。使圆圈居中的正确方法是什么?

最佳答案

请注意 Ellipse2D边界包括左上角的 xy 坐标,以及 widthheight。你可能想要这样的东西:

Shape shape  = new Ellipse2D.Double(-5, -5, 10, 10);

相关实例查看here ,如 response 中所述对此comment .

关于java - 改变 XYPlot 系列点的形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35254013/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com