MathGroup Archive 2009

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

Search the Archive

Re: BarChart and Ticks

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101026] Re: [mg100992] BarChart and Ticks
  • From: Brett Champion <brettc at wolfram.com>
  • Date: Sun, 21 Jun 2009 07:06:10 -0400 (EDT)
  • References: <200906200047.UAA00899@smc.vnet.net>

On Jun 19, 2009, at 7:47 PM, Don wrote:

> I am trying to make the Version 7 BarChart function have the same  
> Ticks capability as what was so easily done in Version 6 using the  
> Ticks option.  Examples of what worked using the Ticks option in  
> Version 6
>
> Example:  (1)
>
> << "BarCharts`"
> BarCharts`BarChart[{{1, 2, 3}, {2, 3, 4}}, Ticks -> {{1, 2, 3},  
> Automatic}]
>
> Example: (2)  Sometimes it is necessary to skip priniting every  
> other number on the X-axis
> when the X-axis becomes too clutered with numbers.
>
> << "BarCharts`"
> BarCharts`BarChart[{{1, 2, 3,4,5}, {2, 3, 4,5,6}}, Ticks -> {{1,  
> 3,5}, Automatic}]
>
>
> The Ticks option does not work  in Version 7:
>
> System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}], Ticks -> {{1, 2,  
> 3}, Automatic}]
>
> (Note that one has to Transpose the data to get the same grouping in
> the bar chart as Version 6, but this is easily done.)
>
> Is there a way to get the same Tick marks  as in Examples (1) and  
> (2) above
> uisng the Version 7 BarChart function with its options?


[If Ticks is completely not working for you (ie. you're getting a  
BarChart::ticks message) then you should update your version from  
7.0.0 to 7.0.1.]

Jaebum has already shown how to get the exact same ticks as V6, but I  
wonder if you're really interested in getting something like one of  
the following:

System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}],
  ChartLabels -> {{1, 2, 3}, None}]

System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}],
  ChartLabels -> {Placed[{1, 2, 3}, Below], None}]

with the label below each group of bars, instead of centered on the  
first bar in each group?


Brett Champion
Wolfram Research


  • Prev by Date: laptop recommendation to run mathematica fast?
  • Next by Date: Re: TeX output via TeXForm: variable name translation
  • Previous by thread: Re: BarChart and Ticks
  • Next by thread: My first calculator =)