Skip to content

Radar plot labels do not match data #4310

@bry-decelles

Description

@bry-decelles

Issue:
Radar plot data points are populated in the inverse direction of the labels. This is true regardless if clockwise is true or false when passed into SetSpokes().

ScottPlot Version: 5.0.39

var plot = new ScottPlot.Plot();

double[] values = [0, 1, 2, 3, 4, 5];
var radar = plot.Add.Radar(values);

double[] tickPositions = [1, 2, 3, 4, 5];
radar.PolarAxis.SetCircles(tickPositions);

var labels = values.Select(v => v.ToString() ).ToArray();
radar.PolarAxis.SetSpokes(labels, values.Max() + 1);

var path = new FileInfo(Path.Combine(Environment.SpecialFolder.Desktop.GetPath(), "radar.png"));
plot.SavePng(path.FullName, 400, 300);

radar

Setting a breakpoint right before SavePng() and inspecting plot.PolarAxis.Spokes shows that each spoke has the correct relative angle (assuming negative angles are clockwise rotation); however PolarAxis.RotationDegrees seems to have the wrong sign relative to the direction of rotation.
image
Unless my interpretation of these properties is incorrect (which could definitely be the case), the entire plot should be rotated clockwise 90 degrees, and then each spoke should be rotated 60 degrees clockwise from there instead of the 90 degree counter-clockwise for the plot and then 60 degree clockwise rotation for each spoke in the series.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions