MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Frame on Bar Chart

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29609] RE: [mg29584] Frame on Bar Chart
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 28 Jun 2001 05:27:59 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hugh,

The following is one method.

xticks = Table[{x, 4(x - 1)}, {x, 1, 25}];

a = BarChart[Transpose[{freq, midpoints}], Frame -> True, Axes -> False,
    FrameTicks -> {xticks, Automatic, Automatic, Automatic},
      PlotRange -> {All, {-0.5, 10}},
    FrameLabel -> {"Marks (%)", "Number of Candidates"}, ImageSize -> 500];

I don't know if you want tick marks without labels on the top and right hand
side of the frame. In any case, I put them there by using Automatic for the
tick specification. False gets rid of the tick marks and the labels.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



> From: Hugh Goyder [mailto:goyder at rmcs.cranfield.ac.uk]
To: mathgroup at smc.vnet.net
>
> Dear Mathgroup,
>
> I wish to plot my students exam results on a bar chart.
>
> I am fussy and think a frame around the plot looks more professional than
> two individual axes and it also enables me to have centred frame labels.
>
> I have thus tried the following
>
> In[1]:=
> data =
> {60,82,81,64,40,48,52,91,57,44,64,41,53,49,37,66,55,76,69,57,48,46
> ,61,67,66,
> 43,86,74,73,56,77,66,81,72,55,45,71,59,45,68,72,64,90,71,76,71,65,
> 82,76,67,18,
> 70,60,88,57,87,93};
>
> In[2]:=
> << "Statistics`DescriptiveStatistics`"
>
> In[3]:=
> << "Graphics`Graphics`"
>
> In[4]:=
> dx = 4;
> freq = BinCounts[data, {0, 100, dx}];
> midpoints = Table[i, {i, 0, 100 - dx, dx}];
>
> In[7]:=
> a = BarChart[Transpose[{freq, midpoints}], Frame -> True, Axes -> False,
>     PlotRange -> {All, {-0.5, 10}}, FrameLabel -> {"Marks (%)", "Number of
> Candidates"}];
>
> In[10]:=
> a = BarChart[Transpose[{freq, midpoints}], Frame -> True, Axes -> False,
>     FrameTicks -> {True, True, False, False}, PlotRange -> {All,
> {-0.5, 10}},
>     FrameLabel -> {"Marks (%)", "Number of Candidates"}];
>
> The first bar chart puts numbers along the top of the frame which I do not
> want. To get rid of this I tried the second set of options. This
> looses the
> midpoint values and plots against point number instead.
>
> I could get the ticks from AbsoluteOptions applied to the first plot and
> put them into the second but I feel that there should be a less roundabout
> method.
>
> Thanks in advance
>
> Hugh Goyder
>
>
>



  • Prev by Date: Re: Frame on Bar Chart
  • Next by Date: Re: Times Ordered Bug with trig functions??
  • Previous by thread: Re: Frame on Bar Chart
  • Next by thread: Re: Frame on Bar Chart