Hi Kevin, If you are brave to make an implementation, I have the following suggestions. - Create a TGraphArrows class derived from TGraph for the 2-D case. See TGraphErrors for an example. TGraph has already all the infrastructure for drawing, computing the range and also supports picking. - We do not have a TGraph3D class. It would be nice to have one. In this case, TGraph3DArraows would make sense. - Do not restrict the implementation to the case of histograms.On my 2 cents Rene Brun Thu, 29 May 2003, Kevin Reil wrote: > Hi Rene, > > Thanks, I knew I could draw the arrows using TArrow. What I have is a 6 > dimensional array, 3 coordinates are position, 3 coordinates are a > direction for that position (photon location and direction). I make a cut > on which photons make it through an aperture and want to plot the location > and direction of these photons. I was hoping there was a prebuilt way to > do this. > > So first I plot the random mess of arrows and positions at the photon > source. Then plot the same plot of photons which make it through the hole > and see that all the arrows are pointing towards one location > > Something like: > TH2Arrows(Float_t pos[2], Float_t dir[2]); > TH3Arrows(Float_t pos[3], Float_t dir[3]); > > I did not expect these to be prebuilt but perhaps someone had an example > readily available. I am sure I can come up with one if no one has one (so > please don't take your time to do it if it's not ready). > > Cheers, > Kevin > > > > |------------------------------------|---------------------------------| > | Kevin Reil | 2575 Sand Hill Road, MS 26 | > | X2447, 103D A&E Bldg. 041 | Menlo Park, CA 94025 | > |------------------------------------|---------------------------------| > | http://www.slac.stanford.edu/~reil | Office (650) 926-2447 | > | reil@slac.stanford.edu | Home (650) 938-1767 | > | http://reil.no-ip.org | Fax (650) 926-5368 | > |----------------------------------------------------------------------| > | And my father dwelt in a tent. | > |----------------------------------------------------------------------| > > On Thu, 29 May 2003, Rene Brun wrote: > > >Hi Kevin, > > > >What is the problem? You can create a TArrow object for each > >of your points (new TArrow(xmin,ymin,xmax,ymax)) > >where xmin,ymin, etc are computed from the bin coordinates. > >It may be more convenient to create one single TArrow, set > >its graphics attributes (line width, angle, etc), > >and use TArrow::DrawArrow to make a new instance. > > > >Note that you can also add the TArrow objects > >to hist->GetListOfFunctions(). When drawing the histogram, > >the arrows will be automatically drawn. > > > > > >Rene Brun > > > >On Wed, 28 May > >2003, Kevin Reil wrote: > > > >> Hi, > >> > >> I would like to ba able to draw an arrow on each point plotted in 2d and > >> 3d histograms. > >> > >> IE at point (2,3) draw a unit arrow pointing in direction (1,0) > >> and loop over points... > >> > >> Or > >> at point (1,1,1) a unit arrow pointing in direction (0,1,1) > >> and loop of points... > >> > >> etc > >> > >> Is there a quick way? > >> > >> Cheers, > >> Kevin > >> > >> |------------------------------------|---------------------------------| > >> | Kevin Reil | 2575 Sand Hill Road, MS 26 | > >> | X2447, 103D A&E Bldg. 041 | Menlo Park, CA 94025 | > >> |------------------------------------|---------------------------------| > >> | http://www.slac.stanford.edu/~reil | Office (650) 926-2447 | > >> | reil@slac.stanford.edu | Home (650) 938-1767 | > >> | http://reil.no-ip.org | Fax (650) 926-5368 | > >> |----------------------------------------------------------------------| > >> | And my father dwelt in a tent. | > >> |----------------------------------------------------------------------| > >> > > > > >
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET