How to make the errors lenghth equal after setlog?

how to draw this markers ?
The markers length is equal,like right.gif.
but i only draw the wrong.gif.
please help me!
it must be: c1->SetLogx(); c1->SetLogy();
root have this markers?
gerrors.C (711 Bytes)



If you want to change the type of marker use:

gr->SetMarkerStyle(n);

where “n” is a number defining the marker type. The following little macro displays them all.

{
   gROOT->Reset();
   TCanvas *c1 = new TCanvas("c1","Test",0,0,400,400);
   c1->SetGridx();
   c1->SetGridy();
   fun1 = new TF1("fun1","10^x",1,3);
   fun1->SetFillColor(1);
   fun1->Draw("C");
   TMarker *marker = new TMarker(2.,TMath::Log10(100.),21);
   marker->SetMarkerSize(4.);
   marker->Draw();
   c1->Print("c1.gif");
}

Sorry,all the errors length are equal in right.gif,but the wrong.gif are not equql.i want to make the errors length is not change after setlogx,setlogy.
Could you tell me how to make them equal?
Or not make setlogx,setlogy for errors length

Could you help me?

Please be patient. People who will answer your mail are not automatic answering machines. They enjoy breaks and week-ends. They will answer your mail once they are back at work.

Rene

Sorry , i am from China,I start work yesterday.
Now ,can you tell me?
I still waiting for you ?
Thanks!

When you go to log scale a small differences, not visible in linear scale, can be emphasis in log scale (that is the whole idea of log scale). So very likely you have a very little difference in length not visible in linear scale which shows up in log scale.

Note that the good policy when you post something on the forum is to send a small running example reproducing the problem you have. This shorten a lot the threads and is much more efficient.

Also keep in mind that a forum is not like an email exchange. You do not speak to one person only but to the whole ROOT users community. So you should keep asking for answers. Do not worry, if somebody, knows how to help you and is willing to do so, you will get a quick answer. Bare also in mind that the sun is not rising at the same time all around the world …

Thanks.
Sorry,i don’t explain my meaning to youl.
I want to draw [color=blue][size=150]a marker with a downarrow[/size] [/color]as in the right.gif,and [size=150][color=blue]the length of downarrow are equal [/color][/size]like as in right.gif!

You are using TGraphAsymmErrors, that’s fine. The arrow length is defined by the vector eyl in your case. You should change this vector to have equal lengths in log scale.

using TGraphAsymmErrors:
but i find the way is diffcult to make the lengths equal!
because i want to the length looks like equal after log scales(as in right.gif)
it is the only way to solve the problem?
[u][color=blue]Can draw a downarrow in the marker position?[/[/color]u]
Or i can make a marker?how to make it?
Thanks!

I understand what you want.

There is no markers having a down arrow shape. There is two ways to achieve what you want:

  1. like now, you can use the TGraphAsymmErrors, and you should make a little computation to make sure that eyl will produce equal length arrow in log scale.

  2. you draw a TArrow at each marker position. Here again you should create a small function doing that.

[quote=“couet”]
2) you draw a TArrow at each marker position. Here again you should create a small function doing that.[/quote]
Thanks!
I hope to everyone can make his marker, for example ,IDL can do this,
i hope root can do all thing!
Best wishes for you!

In the right.gif,the markers with the equal length.
Could you find how to draw them ?
I can’t find.

Ok, here it is.
gerrors.C (744 Bytes)

Hi luzhaoxin,

I hope that you realize that errors are supposed to be part of a measurement. Just like you should not “set” measurements to certain values which you deem appropriate, you shouldn’t “set” errors to a value of your choice, or you run the risk of falsifying data.

Cheers, Axel.

Axel, what this user wants is not “errors” … but some kind of “marker” with the arrow shape.

[quote=“couet”]If you want to change the type of marker use:

gr->SetMarkerStyle(n);

where “n” is a number defining the marker type. The following little macro displays them all.

{ gROOT->Reset(); TCanvas *c1 = new TCanvas("c1","Test",0,0,400,400); c1->SetGridx(); c1->SetGridy(); fun1 = new TF1("fun1","10^x",1,3); fun1->SetFillColor(1); fun1->Draw("C"); TMarker *marker = new TMarker(2.,TMath::Log10(100.),21); marker->SetMarkerSize(4.); marker->Draw(); c1->Print("c1.gif"); } [/quote]
Thanks for you help.
I finished my work,but i want to know:
This programm can’t draw all markers.
why ?

I sent the wrong one I guess… dunno why … sorry… here is the good one:

drawmarker(double x, double y, int mt, double d)
{
   char val[3];
   sprintf(val,"%d",mt);
   double dy=d/3;
   TMarker *m  = new TMarker(x+0.1, y, mt);
   TText   *t  = new TText(x-0.1, y, val);
   TLine   *l1 = new TLine(0,y,1,y);
   TLine   *l2 = new TLine(0,y+dy,1,y+dy);
   TLine   *l3 = new TLine(0,y-dy,1,y-dy);
   l2->SetLineStyle(2);
   l3->SetLineStyle(2);
   m->SetMarkerSize(3.8);
   m->SetMarkerColor(kRed);
   t->SetTextAlign(32);
   t->SetTextSize(0.3);
   t->Draw();
   l1->Draw();
   l2->Draw();
   l3->Draw();
   m->Draw();
}
                                                                                
markers()
{
   TCanvas *c1 = new TCanvas("c1", "c1",14,28,100,800);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderSize(2);
   int i;
   double x = 0.5;
   double y = 0.1;
   double dy = 0.05;
   for (i = 1; i<=7; i++) {
      drawmarker(x, y, i, dy);
      y = y+dy;
   }
   for (i = 20; i<=30; i++) {
      drawmarker(x, y, i, dy);
      y = y+dy;
   }
      c1->Print("c1.gif");
}

[quote=“couet”]

{ gROOT->Reset(); TCanvas *c1 = new TCanvas("c1","Test",0,0,400,400); c1->SetGridx(); c1->SetGridy(); fun1 = new TF1("fun1","10^x",1,3); fun1->SetFillColor(1); fun1->Draw("C"); TMarker *marker = new TMarker(2.,TMath::Log10(100.),21); marker->SetMarkerSize(4.); marker->Draw(); c1->Print("c1.gif"); } [/quote]I don’t understand this programm,only display one of markers?why not display all markers?

Do you read the posts ?

I sent you the correct program just before … !