[graph] TScatter / TScatter2D stops drawing remaining points if a non-positive value is encountered in log scale
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Check duplicate issues
- Checked for duplicates
Description
When plotting a TScatter or TScatter2D on a pad with logarithmic scale enabled (gPad->SetLogx(), SetLogy(), or SetLogz()), encountering any non-positive coordinate (x <= 0, y <= 0, or z <= 0) causes the painter to prematurely terminate the entire rendering loop via else break; instead of skipping the invalid point via else continue;.
As a consequence, if an early point in the array happens to be non-positive, all subsequent valid positive points are omitted from the canvas.
Expected behavior:
Points with non-positive values should simply not be drawn on a log-scale axis, while all other valid positive points in the scatter plot should continue to be rendered.
Observed behavior:
All points appearing after the first non-positive point in the dataset are dropped and never painted.
Reproducer
Save the following self-contained macro as test_scatter_log.C:
void test_scatter_log() {
auto c = new TCanvas("c", "Scatter Log Test", 800, 600);
c->SetLogy();
// 5 points, where index 2 has non-positive y = 0
const int n = 5;
double x[n] = {1.0, 2.0, 3.0, 4.0, 5.0};
double y[n] = {10.0, 20.0, 0.0, 40.0, 50.0};
double col[n] = {1.0, 2.0, 3.0, 4.0, 5.0};
double size[n] = {2.0, 2.0, 2.0, 2.0, 2.0};
auto scatter = new TScatter(n, x, y, col, size);
scatter->SetMarkerStyle(20);
scatter->Draw("A");
c->Update();
// Only points 0 and 1 are drawn; points 3 and 4 are missing because of 'else break;'
}
Run with:
root -l test_scatter_log.C
ROOT version
ROOT 6.34/00 (or current master)
Installation method
Build from source
Operating system
macOS / Ubuntu Linux
Additional context
The issue is located in hist/histpainter/src/TGraphPainter.cxx:
- In
TGraphPainter::PaintScatter(lines ~4500 and ~4506) - In
TGraphPainter::PaintScatter2D(lines ~4734, ~4740, and ~4746)
In all these loops, replacing else break; with else continue; prevents aborting the marker loop when an unrenderable point is reached. This makes a great good first issue for new contributors.
- Lingua principale
- C++
- Stelle
- 3.3k
- Fork
- 1.6k
- Merge medio
- 2g 14h
- PR unite (30g)
- 192
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di root-project/root
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newlineForse già presa @dpiparo l’ha presa 8 giorni fa. Apertabug in:Build System
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
root-project/root#23746 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
RDataLoader: wrong train/validation split with lazy loading, filtered inputs and shuffle=FalseForse già presa @siliataider l’ha presa 1 giorno fa. Apertabug in:ML
root-project/root#23842 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
TDataMember::GetOffset interfers to TDataMember::GetOffsetCintForse già presa @pcanal l’ha presa 5 giorni fa. Apertabug in:Core Libraries
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
root-project/root#23777 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`TChain::GetEntries` internal caching ineffective?Forse già presa @pcanal l’ha presa 11 giorni fa. Apertaimprovement in:TTree
root-project/root#23738 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[PyROOT] Segfault at exit deleting a branch with a Cling-generated collection destructor after cppyy instantiated a templateForse già presa @guitargeek l’ha presa 11 giorni fa. Apertabug in:Python Interface test wit cppjit
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
root-project/root#23728 · 9 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di root-project/root
Issue simili
-
bug intrinsic medium priority rt_lib
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
sumatrapdfreader/sumatrapdf#6417 · 3 commenti ·
-
[BUG] Cython cache evicts most recent instead of oldest entry on cleanupForse già presa @scoder l’ha presa oggi. ApertaBuild System defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NVIDIA-Omniverse/PhysX#590 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno