00001 // $Id: TestStarPalette.C,v 1.1 2000/05/09 20:04:50 kathy Exp $ 00002 // $Log: TestStarPalette.C,v $ 00003 // Revision 1.1 2000/05/09 20:04:50 kathy 00004 // no longer need to set up color palette 00005 // 00006 // Revision 1.3 2000/01/10 15:21:08 kathy 00007 // updated the *Palette macros for changes in ROOT (see email to software-l from Valery on 7jan00) 00008 // 00009 // Revision 1.2 1999/06/25 19:17:27 kathy 00010 // fix the Palette macros so that you can run StarPalette directly from TestStarPalette - thanks, Thoams & Gene! 00011 // 00012 // Revision 1.1 1999/06/24 20:42:22 kathy 00013 // test to show results of Jon Gans' macro to setup star color palette 00014 // 00015 // 00016 //====================================================================== 00017 // owner: Jon Gans/Kathy Turner (took over 10jan00) 00018 // what it does: 00019 // This macro loads and runs the StarPalette macro and shows 00020 // an example plot for the color scheme setup by StarPalette.C 00021 // 00022 // This macro also shows how to load and run another macro from 00023 // a different file. 00024 // 00025 // 10jan00(KT) --> 00026 // This color palette is now implemented automatically 00027 // by ROOT, so one doesn't need to use this! However, I leave 00028 // it here as an example!! 00029 // 00030 // To use: 00031 // Run root4star, then 00032 // .x TestStarPalette.C 00033 // 00034 //======================================================================= 00035 00036 { 00037 // to run another macro from this macro: 00038 gROOT->LoadMacro("StarPalette.C"); 00039 StarPalette(); 00040 00041 gROOT->Reset(); 00042 00043 TCanvas *c1 = new TCanvas("c1","Spectrum Palette",200,10,900,500); 00044 c1->Divide(2,1); 00045 00046 // Generate a 2-D function 00047 TF2 *f2 = new TF2("f2","exp( -5.*(x^2+y^2)^(1/2))*cos((x^2+y^2)^(1/2)*10.0) ",-1.0,1.0,-1.0,1.0); // Example graph 00048 00049 //The following calls are important to set up the color scheme for the 'f2' calls. 00050 00051 f2->SetContour(48); // This is needed to use all 50 colors. (If above 48 it will cycle through color map). 00052 f2->SetFillColor(0); // If using a histogram it is not nessesary. 00053 00054 c1->cd(1); 00055 f2->Draw("SURF1"); 00056 00057 c1->cd(2); 00058 f2->Draw("COLZ"); 00059 00060 00061 } 00062 00063 00064
1.5.9