Re: RE: RE: Multiplelistplot question
- To: mathgroup at smc.vnet.net
- Subject: [mg38787] Re: [mg38770] RE: [mg38759] RE: [mg38746] Multiplelistplot question
- From: Omega Consulting <info at omegaconsultinggroup.com>
- Date: Sun, 12 Jan 2003 06:17:17 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
The trick to writing an ErrorBarFunction is that you write the function for the most general form: ErrorBar[{xneg_, xpos_}, {yneg_, ypos_}] All other forms of ErrorBars are converted to this form before applying the ErrorBarFunction. If you write a function for one of the other forms, then you will get errors. So instead you want the function, myerrorbar[{x_, y_}, ErrorBar[{0, 0}, {yminus_, yplus_}]] := {Red, Line[{{x, y + yminus}, {x, y + yplus}}]} or more generally myerrorbar[{x_, y_}, ErrorBar[{xminus_, xplus_}, {yminus_, yplus_}]] := {Red, Line[{{x, y + yminus}, {x, y + yplus}}], Line[{{x + xminus, y}, {x + xplus, y}}]} -------------------------------------------------------------- Omega Consulting "The final answer to your Mathematica needs" http://omegaconsultinggroup.com At 03:33 AM 1/10/2003, David Park wrote: >Although the MultipleListPlot package has some nice functions in it like >Symbol and MakeSymbol, I always find the standard paradigm difficult to use. >It is often easier to deal directly with graphics primitives. > >Here is an example. > >Needs["Graphics`MultipleListPlot`"] >Needs["Graphics`Colors`"] > >This makes some sample data... > > >data = > Module[{y}, > Table[{{x, y = x + 0.5 + 5Random[Real, {-0.1, 0.1}]}, > ErrorBar[3{-Random[Real, {0.3, 1}], Random[Real, {0.3, 1}]}]}, {x, > 1, 15}]]; > >data >Length[data] > >MultipleListPlot[data]; > >The way to put a style into the error bars should be to use the >ErrorBarFunction option. But, although the example in the Help works, I >could not make an ErrorBarFunction that worked for this case. (After >spending an hour or so.) Perhaps I am making a silly error and someone will >point out how to do it, but in the meantime I suspect there is a bug in the >ErrorBarFunction. > >myerrorbar[p_, ErrorBar[{yminus_, yplus_}]] := > Module[{x, y}, > {x, y} = p; > {Red, Line[{{x, y + yminus}, {x, y + yplus}}]}] > >MultipleListPlot[data, ErrorBarFunction -> myerrorbar]; > >does not work and gives multiple errors. > >So I fell back on using simple graphics primitives. > >data2 = data /. {p_, ErrorBar[{yminus_, yplus_}]} :> > Module[{x, y}, > {x, y} = p; > {Point[p], {Red, Line[{{x, y + yminus}, {x, y + yplus}}]}}]; > >Show[Graphics[ > {AbsolutePointSize[4], > data2}], > Frame -> True, > PlotLabel -> "Error Bars with Style", > ImageSize -> 450]; > >I made simple red lines for the error bars, but one could make them as fancy >as one wants. > >David Park >djmp at earthlink.net >http://home.earthlink.net/~djmp/ > > > >From: SEPULVEDA,ARIEL (HP-PuertoRico,ex1) To: mathgroup at smc.vnet.net >To: mathgroup at smc.vnet.net >[mailto:ariel.sepulveda at hp.com] > >For the axes labels you can use StyleForm or Default font comands. For the >thickness and color of error bars I also have the same question! > >From: Flurchick, Kenneth M [mailto:FLURCHICKK at MAIL.ECU.EDU] To: mathgroup at smc.vnet.net >To: mathgroup at smc.vnet.net > >I am having trouble figuring out how to change the color and thickness of >ErrorBars. Can anyone help me with this problem? ALso, how do you change >the font and font size of an AxesLabel? > >Thank you much for any suggestions. > >Kenf