[jaspQualityControl] Fix incorrect vertical axis titles on surface plots in Quality Cont...#433
Closed
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
Closed
Conversation
…ots in Quality Cont...
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #433 +/- ##
=======================================
Coverage 80.86% 80.86%
=======================================
Files 17 17
Lines 8876 8876
=======================================
Hits 7178 7178
Misses 1698 1698 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue: jasp-stats/jasp-issues#4094
Fix: Incorrect vertical axis titles on surface plots
Root Cause
In
.doeAnalysisPlotContourSurface()(R/doeAnalysis.R), the function correctly iterates over dependent variables withfor (dep in dependent)and usesdepfor plot titles. However, it incorrectly passed the fulldependentvector (e.g.,c("Y1", "Y2", "Y3")) to.doeContourSurfacePlotObject()instead of the loop variabledep.When the plotting function received the vector
c("Y1", "Y2", "Y3")and used it forzlab = dependent, R converted it to a string representation, resulting in incorrect axis labels showing only the first element "Y1" instead of the actual dependent variable being plotted (e.g., "Y2").What Changed
Changed lines 1861 and 1863 in R/doeAnalysis.R:
plot$plotObject <- function(){.doeContourSurfacePlotObject(result, options, dependent, variablePair, ...)}plot$plotObject <- function(){.doeContourSurfacePlotObject(result, options, dep, variablePair, ...)}This passes the current dependent variable from the loop iteration to the plot function, ensuring the correct z-axis label is displayed.
Testing
Implementation Plan
Plan: Fix incorrect vertical axis titles on surface plots
Root Cause
In
.doeAnalysisPlotContourSurface(lines 1861 and 1863 of R/doeAnalysis.R):for (dep in dependent)(line 1828)depfor plot titles (line 1857)dependentvector (e.g.,c("Y1", "Y2", "Y3")) to.doeContourSurfacePlotObject.doeContourSurfacePlotObject, line 1892 useszlab = dependentto set the z-axis labelc("Y1", "Y2", "Y3"), R converts it to string"c(\"Y1\", \"Y2\", \"Y3\")"for displayThis is why the z-axis shows "Y1" (first element of the incorrectly passed vector) instead of the correct dependent variable (e.g., "Y2").
Proposed Changes
Change lines 1861 and 1863 in
R/doeAnalysis.R:dependenttodepdependenttodepThis passes the current dependent variable from the loop iteration to the plot function.
Test Impact
Test Results