A New Kind of Science: The NKS Forum > Pure NKS > Mathematica Help Required
Author
Joe Hoppe

Registered: Feb 2004
Posts: 4

Mathematica Help Required

I just have two simple questions about Mathematica. I don't know if this is the most appropriate forum - if it isn't, it would appreciated if someone could point me in the right direction.

I am trying to create a graphic of a simple one dimensional automaton. The problem is I want the cellular grid to be shown in addition the automaton. The attached contains some basic code; it's basically the RasterGraphics function from the 'Further Examples' and a simple call of the CellularAutomaton[] function.

Also, in a less related question, how may I set the ymax and ymin when using ListPlot? The attached demonstrates my usage of it.

All suggestions welcome; they will really expedite my paper.

Joe Hoppe

Attachment: lacking_grid.nb

Report this post to a moderator | IP: Logged

03-26-2004 03:32 AM
Richard Phillips
Wolfram Science Group
Boston, USA

Registered: Oct 2003
Posts: 46

I will answer your question here, but in general pure Mathematica questions are best directed at the MathGroup or Student support forums (the later if you have the student edition) See http://forums.wolfram.com/. Direct Technical Support is available to Mathematica Premier Service subscribers.

The following version of RasterGraphics includes a mesh:

RasterGraphics[state_?MatrixQ, colors_Integer : 2, opts___] :=
Graphics[{Raster[Reverse[1 - state/(colors - 1)]]
Table[Line[{{0, i}, {Length[First[state]], i}}], {i, 0, Length[state]}], Table[Line[{{i, 0}, {i, Length[state]}}], {i, 0, Length[First[state]]}]}, AspectRatio -> ((AspectRatio /. {opts}) /. AspectRatio -> Automatic), opts]

You can also use:

ListDensityPlot[1-Reverse[state], Mesh->True, ColorFunctionScaling->False, Frame -> False, AspectRatio -> Automatic]

To specify an explicit range of visible y-coordinates in ListPlot you can use:

ListPlot[data, PlotRange -> {ymin, ymax}]

Report this post to a moderator | IP: Logged

03-26-2004 05:28 AM
Joe Hoppe

Registered: Feb 2004
Posts: 4

Thanks

Thank you for the direction and assitance. It is much appreciated.

Report this post to a moderator | IP: Logged

03-26-2004 02:44 PM

wolframscience.com  |  wolfram atlas  |  NKS online  |  web resources  |  contact us