From 49de8fd7e0c5f4ca08853f20dae56d1b1e8ace4f Mon Sep 17 00:00:00 2001 From: AKMaily Date: Thu, 17 Oct 2024 14:29:14 +0200 Subject: [PATCH] Cursor visible in plot, axis set before first plot --- src/handler.cpp | 7 ++++--- src/main.cpp | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/handler.cpp b/src/handler.cpp index e6ccbd20..6793bcf1 100644 --- a/src/handler.cpp +++ b/src/handler.cpp @@ -79,16 +79,17 @@ void addPlots(const char *name, fs::path &AnalyzedFilePath, bool &LOADANALYSISDA axesSetup) { static std::set firstRun; auto const plotRegion = ImGui::GetContentRegionAvail(); - ImVec2 adjustedPlotRegion(plotRegion.x - 100, plotRegion.y); // TODO search devices must work aswell plotAxes = getDeviceInfos(); - if (ImPlot::BeginPlot(name, adjustedPlotRegion, ImPlotFlags_NoFrame)) { + if (ImPlot::BeginPlot(name, plotRegion)) { + ImPlot::SetupAxis(ImAxis_X1, "[x]"); + ImPlot::SetupAxis(ImAxis_Y1, "[y]"); if(!AnalyzedFilePath.empty() && LOADANALYSISDATA){ AddPlotFromFile(AnalyzedFilePath); ImPlot::EndPlot(); - ImPlot::PopStyleColor(); + ImPlot::PopStyleColor(); } else { diff --git a/src/main.cpp b/src/main.cpp index 16ad1a66..39a9714a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -102,12 +102,11 @@ int main() { appLanguage[Key::Recording_Data],AnalyzedFilePath,LOADANALYSISDATA, [flagPaused](double x_max, std::string yLabel, ImAxis_ axis, double yMin, double yMax) { - ImPlot::SetupLegend(ImPlotLocation_NorthEast); + ImPlot::SetupLegend(ImPlotLocation_NorthWest); // auto auxFlagsMeasuring = // ImPlotAxisFlags_AutoFit | ImPlotAxisFlags_NoGridLines; // auto auxFlagsPaused = ImPlotAxisFlags_NoGridLines; - ImPlot::SetupAxisTicks(ImAxis_Y1, -10, 200, 22, nullptr, true); - + //ImPlot::SetupAxisTicks(ImAxis_Y1, -10, 200, 22, nullptr, true); if (!flagPaused) { ImPlot::SetupAxis(axis, yLabel.c_str(), ImPlotAxisFlags_AutoFit); ImPlot::SetupAxis(ImAxis_X1, appLanguage[Key::Time_sec],