-
Hello! I'm using OxyPlot to draw the spectrums of some sound files. Actually they are just a kind of Plot plot = new();
var heatmap = plot.Add.Heatmap(values);
plot.Add.ColorBar(heatmap);
plot.SavePng("test.png", 10000, 10000); Of course I should also share the data here: You can load the data file like: var lines = File.ReadAllLines("values.txt");
var length2 = lines[0].Split(',', StringSplitOptions.RemoveEmptyEntries).Length;
var values = new double[lines.Length, length2];
for(int i = 0; i < lines.Length; i++)
{
var split = lines[i].Split(',', StringSplitOptions.RemoveEmptyEntries);
for(int j = 0; j < split.Length; j++)
{
values[i, j] = double.Parse(split[j]);
}
} Then the previous program will generate a image like: It seems 'ugly', but in general it's what a spectrum should be. However these horizontal lines are not expected: I have also tried to manually modify the So... have I did something wrong? Thanks for help in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's a problem in my other steps... And... |
Beta Was this translation helpful? Give feedback.
It's a problem in my other steps... And...
[511, 0]
will be drawn to the bottom left corner (0, 0
) rather than0, 511