Re: Multiplelistplot question
- To: mathgroup at smc.vnet.net
- Subject: [mg38779] Re: Multiplelistplot question
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sun, 12 Jan 2003 06:16:56 -0500 (EST)
- References: <avm49p$n8m$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
David,
The default input into the error bar function is the sequence
point, {{xminus, xplus}, {yminus, yplus}}.
Adjusting for this, your function myerrorbar becomes (I have added
thickness):
myerrorbar[p_, ErrorBar[{xminus_, xplus_}, {yminus_, yplus_}]] :=
Module[{x, y}, {x, y} = p;
{Thickness[.02], Red,
Line[{{x + xminus, y + yminus}, {x + xplus, y + yplus}}]}]
which works:
Needs["Graphics`MultipleListPlot`"]
Needs["Graphics`Colors`"]
data = Module[{y}, Table[
{{x, y = x + 0.5 + 5*Random[Real, {-0.1, 0.1}]},
ErrorBar[3*{-Random[Real, {0.3, 1}],
Random[Real, {0.3, 1}]}]}, {x, 1, 15}]];
MultipleListPlot[data, ErrorBarFunction -> myerrorbar];
Clearly we can do more fancy things.
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"David Park" <djmp at earthlink.net> wrote in message
news:avm49p$n8m$1 at smc.vnet.net...
> 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
> [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
>
> 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
>
>