Message Boards Message Boards

1
|
6119 Views
|
6 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Cellular Automaton Vector Export

POSTED BY: Jesse Friedman
6 Replies
MapIndexed[If[#1==1,Rectangle[#2+0.15]]&,Reverse[Transpose@CellularAutomaton[30,{{1},0},90],2],{2}]//Graphics

enter image description here

POSTED BY: Simon Cadrin

That works as well, although I would argue that it is bad practice to feed Graphics a list containing null values.

POSTED BY: Jesse Friedman
ArrayPlot[CellularAutomaton[30, {{1}, 0}, 90]]

enter image description here

POSTED BY: Simon Cadrin

If you examine the SVG outputted by that, you will notice that it isn't actually vector, but a raster bitmap embedded in the file. This is why I made my code in the first place, as indicated in the second sentence of my original post.

POSTED BY: Jesse Friedman
MapIndexed[If[#1 == 1, Rectangle[#2 + 0.05]] &,  Reverse[Transpose@CellularAutomaton[30, {{1}, 0}, 100],  2], {2}] // Graphics

enter image description here

POSTED BY: Simon Cadrin

Nothing is a new feature introduced in Mathematica 10.2. I probably should have noted that in my post.

You can change it to Missing[] and add a DeleteMissing.

POSTED BY: Jesse Friedman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract