realgamessoftware/dear-imgui-unity

Potential Bug with ImPlot.PlotLine

wangqinru opened this issue · 0 comments

I'm currently using ImPlot.PlotLine to draw graphs in my project. However, I'm encountering an issue where the numbers on the X and Y axes aren't being displayed. Do you have any idea what might be causing this?

I'm running this on Unity 2022.2.1f1.

Any help would be greatly appreciated.

Thank you.

image

double xmin = 0, xmax = 1, ymin = 0, ymax = 1;
float[] data = new float[10]{0,1,2,3,4,5,6,7,8,9};

ImPlot.LinkNextPlotLimits(ref xmin, ref xmax, ref ymin, ref ymax);
if (ImPlot.BeginPlot("Plot A", "Time (s)", "Memory (MB)", new Vector2(400, 200))) { 
    ImPlot.PlotLine("Line", ref data[0], 10);
    ImPlot.EndPlot(); 
}

ImPlot.LinkNextPlotLimits(ref xmin, ref xmax, ref ymin, ref ymax);
if (ImPlot.BeginPlot("Plot B", "Time (s)", "Memory (MB)", new Vector2(400, 200))) { 
    ImPlot.PlotLine("Line", ref data[0], 10);
    ImPlot.EndPlot(); 
}