MathGroup Archive 2002

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

Search the Archive

RE: How to transform x axis on ListPlot?

  • To: mathgroup at
  • Subject: [mg33172] RE: [mg33140] How to transform x axis on ListPlot?
  • From: David.Annetts at
  • Date: Wed, 6 Mar 2002 01:56:04 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Hi Rob,

> Greetings cypherists, I have another problem that I bring up 
> only after a long time of putting up with no solution.  I 
> have a list which I plot but the integer x axis of the plot 
> is not scaled to suit me. Each position in the list results from some
> increment of a variable which I'd like to represent on the 
> graph.  About all I've been able to do so far is to rig up 
> the list so that each entry in the array/list being plotted 
> represents some integer multiple of the actual variable so 
> things don't get
> too confusing.  For example:
> x=Table[Sin[z],{z, 3.0, 0.01}];
> ListPlot[x]
> The plot looks nice but the x axis goes from 0 to 300 and I'd 
> like it to go from say, 0 to 600 (MHz).  Surely this is 
> easily done but I haven't found a single example of this in 
> the books or in reviewing the posts on this ng.

The first problem is your list; x contains values of Sin[z] ranging from 3.0
to 0.01 in steps of 1 ie, your list contains nothing.  

Assuming you want
x = Table[Sin[z], {z, 0, 3.0, .01}];, 
you can control the range via PlotRange, an option to ListPlot.

For example, 

ListPlot[x, PlotRange -> {{0, 600}, All}];
ListPlot[x, PlotRange -> {{0, 600}, {-1, 1}}];

> Options[ListPlot] doesn't help me either.


\!\({AspectRatio \[Rule] 1\/GoldenRatio, Axes \[Rule] False, 
    AxesLabel \[Rule] None, AxesOrigin \[Rule] Automatic, 
    AxesStyle \[Rule] Automatic, Background \[Rule] Automatic, 
    ColorOutput \[Rule] Automatic, DefaultColor \[Rule] Automatic, 
    Epilog \[Rule] {}, Frame \[Rule] True, FrameLabel \[Rule] None, 
    FrameStyle \[Rule] Automatic, FrameTicks \[Rule] Automatic, 
    GridLines \[Rule] None, ImageSize \[Rule] Automatic, 
    PlotJoined \[Rule] True, PlotLabel \[Rule] None, PlotRange \[Rule] All, 
    PlotRegion \[Rule] Automatic, PlotStyle \[Rule] Automatic, 
    Prolog \[Rule] {}, RotateLabel \[Rule] True, Ticks \[Rule] Automatic, 
    DefaultFont \[RuleDelayed] $DefaultFont, 
    DisplayFunction \[RuleDelayed] $DisplayFunction, 
    FormatType \[RuleDelayed] $FormatType, 
    TextStyle \[RuleDelayed] $TextStyle}\)

PlotRange is right there between PlotLabel & PlotRegion ....


  Dr. David Annetts             EM Modelling Analyst
  Tel: (+612) 9490 5416         CSIRO DEM, North Ryde
  Fax: (+612) 9490 5467         David.Annetts at
                 Include "usual_disclaimers"

  • Prev by Date: Re: Bug in Simplify?
  • Next by Date: MathML Conference: Demo and Poster Submission Deadline
  • Previous by thread: RE: How to transform x axis on ListPlot?
  • Next by thread: Re: How to transform x axis on ListPlot?