MathGroup Archive 2007

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

Search the Archive

RE: Problem with FrameTicks and BarLabels


Hi Tom,

> I would like tick marks only where there is a Tick Mark Label 
> on the below graph ((using version 6) :
> 
> Show[BarChart[{97, 2345, 89}, BarOrientation -> Horizontal,
>   BarLabels -> {"a", "b", "c"},
>   GridLines -> {{0, 500, 1000, 1500, 2000, 3000}, None}]]
> 
> However, if I stipulate FrameTicks, I lose my BarLabels, and 
> am not allowed to put anything but a number into FrameTicks :
> 
> Show[BarChart[{97, 2345, 89}, BarOrientation -> Horizontal,
>   BarLabels -> {"a", "b", "c"},  Frame -> True,
>   FrameTicks -> {{None, None}, {{0, 500, 1000, 1500, 2000, 3000},
>      None}}, GridLines -> {{0, 500, 1000, 1500, 2000, 3000}, None}]]
> 
> Any ideas how I can get the BarLabels back but retain the new 
> FrameTicks ?

The way to do this, as prompted by a similar question a few months ago from
Nasser Abbasi answered by Jean-Marc Gulliet amongst others, seems to be to
roll your own ticks.

Defining

	ytik = Transpose[{Range[3], {"a", "b", "c"}}]

Then

	Show[BarChart[{97, 2345, 89}, BarOrientation -> Horizontal,
	  Frame -> True, 
	  FrameTicks -> {{ytik, None}, {{0, 500, 1000, 1500, 2000, 3000},
None}}, 
	  GridLines -> {{0, 500, 1000, 1500, 2000, 3000}, None}]
	]

Works fine.

Regards,

Dave.


  • Prev by Date: Re: Re: help plot log[f[t]] vs a parameter using an ODE
  • Next by Date: Re: How to make delayed functions from text info
  • Previous by thread: Problem with FrameTicks and BarLabels
  • Next by thread: Re: Problem with FrameTicks and BarLabels