Skip to content

Make "LIST" draw option for contour plot work with "CONT1", "CONT2", and "CONT3" options #20858

@bgrube

Description

@bgrube

Feature description

Currently, only the draw option "CONT0 LIST" creates an entry in the list of specials containing the graphs of the drawn contours. However, this does not work if "LIST" is combined with "CONT1", "CONT2", or "CONT3", as illustrated by

void test (const std::string& drawOption)
{
	TF2 fcn = TF2("fcn", "x", 0, 1, 0, 1);
	TH1* hist = fcn.GetHistogram();
	hist->SetContour(2);
	hist->Draw((drawOption + "Z LIST").c_str());
	gPad->Update();
	if (gROOT->GetListOfSpecials()->Contains("contours")) {
		std::cout << drawOption << ": found contours" << std::endl;
	} else {
		std::cout << drawOption << ": did not find contours" << std::endl;
	}
	gROOT->GetListOfSpecials()->ls();
}

void testContours()
{
	// test("CONT0");  // this works
	// these do not work:
	test("CONT1");
	test("CONT2");
	test("CONT3");
}

It would be desirable to make these options work as "CONT0".

Alternatives considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions