epezent / implot

Immediate Mode Plotting
MIT License
4.78k stars 531 forks source link

Axes decorations are still rendered after passing ImPlotAxisFlags_NoDecorations #356

Closed swinefeaster closed 2 years ago

swinefeaster commented 2 years ago

is this a recent regression in v.0.13 or am i doing something wrong?

image

`

ImPlot::PushStyleVar(ImPlotStyleVar_PlotPadding, ImVec2{});
ImPlot::PushStyleVar(ImPlotStyleVar_PlotBorderSize, 0.2f);
{
    ImPlotFlags plotFlags = ImPlotFlags_Equal | ImPlotFlags_NoLegend | ImPlotFlags_AntiAliased | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect;
    {
        if (!showCaption)
        {
            plotFlags |= ImPlotFlags_NoTitle;
        }
    }

    if (ImPlot::BeginPlot(caption, plotData.size, plotFlags))
    {
        ImPlot::SetupAxis(0, nullptr, ImPlotAxisFlags_NoDecorations);
        ImPlot::SetupAxis(1, nullptr, ImPlotAxisFlags_NoDecorations);
        ImPlot::SetNextMarkerStyle(ImPlotMarker_Circle, 6, k_white, IMPLOT_AUTO, k_white);
        ImPlot::PlotScatterG("Data", [](void * data, int sampleIndex)

`

epezent commented 2 years ago

Your problem is that you are hardcoding a 1 for the y-axis index. Use ImAxis_Y1, which evaluates as 3 on my machine:

        ImPlot::SetupAxis(ImAxis_X1, nullptr, ImPlotAxisFlags_NoDecorations);
        ImPlot::SetupAxis(ImAxis_Y1, nullptr, ImPlotAxisFlags_NoDecorations);