Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

RE: Problem with FrameTicks and BarLabels

  • To: mathgroup at smc.vnet.net
  • Subject: [mg81168] RE: [mg81123] Problem with FrameTicks and BarLabels
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Fri, 14 Sep 2007 03:42:12 -0400 (EDT)
  • References: <200709131026.GAA15740@smc.vnet.net>

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