无法在条形图上显示百分比

时间:2020-08-14 09:23:04

标签: pandas bar-chart data-science seaborn

我在下面建立了代码,以在小节上方显示百分比。但是在运行代码时,百分比不会显示。

任何人都可以帮助我,在百分比表的顶部获得百分比。

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以尝试一下。

public synchronized void setMotion(float xDistance, float yDistance) {

    kx = kx + xDistance * 0.001f;
    ky = ky + yDistance * 0.001f;
    
    x = (float) (radius * Math.cos(ky) * Math.sin(kx));
    z = (float) (radius * Math.cos(ky) * Math.cos(kx));
    y = (float) (radius * Math.sin(ky));


    float[] up =
    {
        (float) (Math.sin(ky) * Math.sin(kx)),
        (float) (Math.cos(ky)),
        (float) (Math.sin(ky) * Math.cos(kx)),
    };
    Matrix.setLookAtM(viewMatrix, 0,
            x, -y, z,
            0f, 0f, 0f,
            up[0], up[1], up[2]
    );

}