There is an alignment issue with the Chinese font
Author: ZhuYajunFlyCreated Feb 28, 2026Updated Sep 7, 2026
Issue: (Describe the bug here) There is an alignment issue with the Chinese font. 1.The bottom scale value text is very close to the bottom axis. 2.Legend text is not fully displayed ScottPlot Version: (What NuGet package are you using?) ScottPlot.WPF 5.1.57 Code Sample: See http://scottplot.net/faq/repro/ for tips about creating reproducible code samples
var plot4 = App.Current.Services.GetRequiredService<MainWindow>().HistoryPlot1;
plot4.Plot.XLabel("时间 (5ms)");
plot4.Plot.Font.Set("思源宋体");
...
var plot1 = App.Current.Services.GetRequiredService<MainWindow>().HistoryPlot1;
var m1v = plot1.Plot.Add.Signal(plcdata.Select(d => d.M1Velocity).ToArray());
var m2v = plot1.Plot.Add.Signal(plcdata.Select(d => d.M2Velocity).ToArray());
m1v.LegendText = "M1转速";
m2v.LegendText = "M2转速";
plot1.Plot.ShowLegend();
plot1.Plot.Axes.AutoScale();
plot1.Refresh();
fig:
Source: ScottPlot/ScottPlot