Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TScatter plotting axis problem #13124

Closed
1 task
cxwx opened this issue Jun 29, 2023 · 3 comments
Closed
1 task

TScatter plotting axis problem #13124

cxwx opened this issue Jun 29, 2023 · 3 comments

Comments

@cxwx
Copy link
Contributor

cxwx commented Jun 29, 2023

Check duplicate issues.

  • Checked for duplicates

Description

new TScatter feature is exciting, but I met a bug when I use TScatter::Draw and gPad->DrawFrame() at the same time.

Reproducer

#include <TScatter.h>
#include <TCanvas.h>
#include <TPad.h>

void scatter()
{
	TCanvas * c1 = new TCanvas();
	c1->Divide(2,2);
	c1->cd(1);
	gPad->DrawFrame(-70, -70, 70, 70);
	const int n = 10;
	double x[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
	double y[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
	double c[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
	double s[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
	auto scatter = new TScatter(n, x, y, c, s);
	scatter->Draw("P same");

}

cause axis problem like below
截屏2023-06-29 20 49 30

ROOT version


| Welcome to ROOT 6.29/01 https://root.cern |
| (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for macosxarm64 on Jun 21 2023, 03:10:00 |
| From heads/master@v6-29-01-1680-gffdc579bbc |
| With Apple clang version 14.0.3 (clang-1403.0.22.14.1) |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |

Rint
version: 6.29/01
building time: 20230621 310
Version time:1150

Installation method

building from source

Operating system

macos m1

Additional context

No response

@cxwx cxwx added the bug label Jun 29, 2023
@couet
Copy link
Member

couet commented Jun 29, 2023

great you found it. I 'll check.

@couet
Copy link
Member

couet commented Jun 29, 2023

It behaves like a TGraph. You do not need the option same:

void scat2()
{
   TCanvas * c1 = new TCanvas();
   gPad->DrawFrame(-70, -70, 70, 70);
   const int n = 10;
   double x[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
   double y[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
   double c[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
   double s[n] = {-80, -70, -60, -50, -40, -30, -20, -10, 0, 10};
   auto scatter = new TScatter(n, x, y, c, s);
   scatter->Draw("P");
}

@couet couet closed this as completed Jun 29, 2023
@github-actions
Copy link

Hi @couet,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

@couet couet added this to Issues in Fixed in: not applicable via automation Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants