TCanvas Update() resets TGraph SetMarkerStyle

Hello,
The problem I have is that in my software i can set TGraph::SetMarkerColor and TGraph::SetMarkerStyle but first remains fixed and the second is resetted after i call TCanvas::Update

here some code:

TCanvas * realtimeC;
TMultiGraph * realtimeG;
TGraph * RTaG[4];
RTaG[0] = new TGraph( 100 );
RTaG[0]->SetMarkerColor(3);
RTaG[0]->SetMarkerStyle(7);
realtimeG = new TMultiGraph();
realtimeG->Draw("A*");
realtimeC->Update();

// EXAMPLE 1
while(true){
   // here RTaG[0]->GetMarkerStyle() always 7
   realtimeC->Update();
   // here RTaG[0]->GetMarkerStyle() always 7
}


// EXAMPLE 2
while(true){
    // RTaG[0]->GetMarkerStyle() is 7
   RTaG[0]->SetPoint(1, 1., 1.);
    // RTaG[0]->GetMarkerStyle() is 7
   realtimeC->Update();
    // RTaG[0]->GetMarkerStyle() is 3
}

This doesn’t make sense to me. Is something related to the realtimeG->Draw(β€œA*”)? How can i change the standard marker?

Thanks

The option β€œ*” (star) means β€œuse the marker having the * shape” … use β€œP” instead.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.