Re: Frame on Bar Chart
- To: mathgroup at smc.vnet.net
- Subject: [mg29610] Re: [mg29584] Frame on Bar Chart
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Thu, 28 Jun 2001 05:28:00 -0400 (EDT)
- References: <200106270912.FAA04002@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Try using the correct values for the FrameTicks option: instead of FrameTicks -> {True, True, False, False}, use FrameTicks -> {Transpose[{Range[1, 25], ToString /@ midpoints}], Automatic, None, None}. Incidentally, to use BinCounts you need the AddOn Statistics`DataManipulation` , instead of Statistics`DescriptiveStatistics`. Tomas Garza Mexico City ----- Original Message ----- From: "Hugh Goyder" <goyder at rmcs.cranfield.ac.uk> To: mathgroup at smc.vnet.net Subject: [mg29610] [mg29584] Frame on Bar Chart > 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,1 8, > 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 > > >
- References:
- Frame on Bar Chart
- From: Hugh Goyder <goyder@rmcs.cranfield.ac.uk>
- Frame on Bar Chart