Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Flipping axes on Graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97415] Re: Flipping axes on Graphics
  • From: Harrie Kraai <hakraai at xs4all.nl>
  • Date: Thu, 12 Mar 2009 05:44:32 -0500 (EST)
  • References: <gpad36$n1p$1@smc.vnet.net>

Dear Sidney, I think the only way to go is to flip the graph and use 
explicit Ticks.

Plot[-Sin[x], {x, 0, 2 Pi},
  Ticks -> {Automatic, {{-1, 1}, 0, {1, -1}}}];

However I do not really like this solution because you bypass 
Mathematica's cleaver Ticks selection algorithm.
You can put in some of your own cleaverness using the Ticks->'func' 
option (see documentation for Ticks)

Another one of my feature requests to Wolfram would be to be able to 
supply an (e.g.) TickLabelFunction option that would be able to modify 
the Tick labels. Sometimes it is desired to simply divide by 1000 or, as 
in your case, negate. So: TickLabelFunction->{Automatic,(-#)&} would be 
excellent. Alas....

HK

sidney at jigsaw.nl wrote:
> Dear all,
> 
> I am looking for a way to flip the direction of an axis that is used
> to render a Graphics object.
> 
> For example, I would like to be able to do Plot[Sin[x], {x, 0, 2*Pi}]
> but the top-left corner of the rendered Graphics object would
> correspond to coordinate (0,-1) while the bottom-left corner would
> correspond to (0, +1); effectively, the graph would need to be
> mirrored in the x-axis.
> 
> I've skimmed all Graphics options and it seems the convention that
> increasing x is rendered left-to-right and increasing y is rendered
> bottom-to-top is hard-wired into Graphics. Would there be a clever way
> to get around this?
> 
> Best regards, Sidney
> 
> 


  • Prev by Date: Re: Using Select
  • Next by Date: Re: General form of a summation as a function of 2
  • Previous by thread: Flipping axes on Graphics
  • Next by thread: Re: Flipping axes on Graphics