Exporters.Plotting: ScottPlot histogram export #2711
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's my understanding that the existing R plot exporters includes a density plot, but I don't know what kind of smoothing that goes through. ScottPlot does support calculating this from a histogram but it doesn't support the necessary kernel density estimation. So your options are to either compute the discrete PDF (unlikely to be appropriate unless there's hundreds of bins) or assume a normal distribution (almost certainly not appropriate). And then you can potentially add smoothing on top of that (e.g. turn it into a bezier or compute a moving average).
I figure that a histogram is at least part of the way there, and I might look at adding a KDE implementation into ScottPlot, since it would unlock a few plot types that we've never supported before.
On real data it looks something like this:

On test data it looks more like this:

I'm noticing that the chart is fairly messy, since there are multiple histograms in the same colour (as they're in the same job). Unless I did something wrong while grouping the data, this suggests that either histograms may not be a great option to have enabled by default (if this is typical of real-world usage) or that there might need to be separate test cases which are less busy (if this isn't typical of real-world usage).
This may be unrelated, but I noticed that the R exporter shows multiple plots in one image. This is supported in ScottPlot, so if you want to go that route that is an option. Here's a couple of examples: https://scottplot.net/cookbook/5.0/MultiplotRecipes/