Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8018
| From | Tomas Garza <tgarza10@msn.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: BoxWhiskerChart and a Vertical Line on same graph |
| Date | 2012-01-20 06:48 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jfb2nr$hjl$1@smc.vnet.net> (permalink) |
| References | <201201191011.FAA03691@smc.vnet.net> |
Much to my surprise (I'm not very familiar with BoxWhiskerCharts) the ChartLegend option seems to be the cause of the problem. In addition. if you want the vertical line to be between the first and second pair of boxes, I can't see why you set xv = 10; it should be somewhere between 2.8 and 3. Try the following:
data = Table[ RandomVariate[NormalDistribution[RandomInteger[5], 1], 100], {2}, {2}];
grBox2 = BoxWhiskerChart[data,(*ChartLegends->{"a","b"},*) AxesLabel -> {"Quintile", "Price"}, Frame -> False, Axes -> True, AxesOrigin -> {0, 0}];
xv = 2.9;graphicLine = Graphics[Line[{{xv, 0}, {xv, 8}}]];Show[grBox2, graphicLine]
You must find out why the ChartLegend is causing havoc (check with Wolfram support - it might be , I hate to say, a bug).
-Tomas
> Date: Thu, 19 Jan 2012 05:11:41 -0500
> From: donabc@comcast.net
> Subject: BoxWhiskerChart and a Vertical Line on same graph
> To: mathgroup@smc.vnet.net
>
> Here is a BoxWhisker graph, which is only a slight variation on one of the
> examples for BoxWhisker graphs in the documentation.
>
> data=Table[RandomVariate[NormalDistribution[RandomInteger[5],1],100],{2},{2}];
>
> grBox1 = BoxWhiskerChart[data, ChartLegends->{"a","b"},AxesLabel->{"Quintile", "Price"},
> Frame->False, Axes->True, AxesOrigin->{0,0}
> ]
>
> I would like to superimpose a vertical line on the graph between
> the first and second PAIR of boxes (i.e. between the
> first two and the second two).
>
> My attempt to do this is the following:
>
> xv = 10;
> graphicLine = Graphics[Line[{{xv,0},{xv,8}}]] ;
> Show[grBox1,graphicLine]
>
> but this produces no graph and an error message
> in the pink window which says:
>
> "Labeled is not a Graphics primitive or directive"
>
> But, I am not using anything in the code above which
> is called "Labeled".
>
> Is there a way to superimpose this line on the BoxWhisker Chart?
>
> Thank you in advance.
>
> Don
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: BoxWhiskerChart and a Vertical Line on same graph Tomas Garza <tgarza10@msn.com> - 2012-01-20 06:48 +0000
csiph-web