scottplot xticks not showing

361 views Asked by At

I have the following graph, where the labels defined through a call to xticks() are not showing for scottplot, anyone knows why?

Cf. picture hereafter and corresponding code snippet

enter image description here

        var plt2 = new ScottPlot.Plot(800, 600);
        plt2.AddBar(valuesBot.ToArray(), tickPositions.ToArray(), System.Drawing.Color.Red);
        plt2.AddBar(valuesTop.ToArray(), tickPositions.ToArray(), System.Drawing.Color.Green);
        plt2.SetAxisLimitsY(0, 2800); //TODO: size to maximum value        
        plt2.XLabel("AlertTypes");
        plt2.YLabel("#Occurences");
        plt2.Title("Open vs Closed Alerts");
        string[] ticks = alertTypesList.ToArray();
        plt2.XTicks(tickPositions.ToArray());
        plt2.SaveFig("AlertsReceivedAbsolute.png");

I'm not seeing the xticks defined by plt2.XTicks(tickPositions.ToArray());

1

There are 1 answers

1
Ben On BEST ANSWER

It looks like you're using the beta version (4.1.x) of ScottPlot. A new beta build 4.1.7 was released today (at the time of writing about 30 minutes ago) and it seems to address this issue: https://github.com/ScottPlot/ScottPlot/releases/tag/4.1.7-beta

If updating to 4.1.7 doesn't fix this then using a stable build (4.0.x) would probably make the most sense.