Skip to content

Commit

Permalink
Fix for tick generator
Browse files Browse the repository at this point in the history
  • Loading branch information
macaba committed Aug 21, 2024
1 parent afcb0fc commit 28f02af
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions source/NSD.UI/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,20 @@ private void InitNsdChart()
private void CommonChartConfig()
{
static string logTickLabels(double y) => Math.Pow(10, y).ToString(); // "N0"
NumericAutomatic logTickGenerator = new()
NumericAutomatic xTickGenerator = new()
{
LabelFormatter = logTickLabels,
MinorTickGenerator = new LogMinorTickGenerator() { Divisions = 10 },
IntegerTicksOnly = true,
};
WpfPlot1.Plot.Axes.Bottom.TickGenerator = logTickGenerator;
WpfPlot1.Plot.Axes.Left.TickGenerator = logTickGenerator;
NumericAutomatic yTickGenerator = new()
{
LabelFormatter = logTickLabels,
MinorTickGenerator = new LogMinorTickGenerator() { Divisions = 10 },
IntegerTicksOnly = true,
};
WpfPlot1.Plot.Axes.Bottom.TickGenerator = xTickGenerator;
WpfPlot1.Plot.Axes.Left.TickGenerator = yTickGenerator;
WpfPlot1.Plot.XLabel("Frequency (Hz)", 18);
WpfPlot1.Plot.YLabel("Noise (nV/rHz)", 18);
WpfPlot1.Plot.Axes.Bottom.Label.Bold = false;
Expand Down

0 comments on commit 28f02af

Please sign in to comment.