Monday, March 13, 2017

information graphics - How to space objects logarithmically / exponentially in Illustrator?


I'm working on a chart that has to be on a base-10 log scale (meaning, the divisions are at 1, 10, 100, 1000 instead of 10, 20, 30, 40), and I'm trying to make it more intuitive and obvious to people who don't understand log scales and/or might not notice the non-standard scale. One of the ideas I'm trying is, to have subtle ticks / lines spaced out at regular intervals so an inattentive viewer will notice that the scale 'barrels' away and the ticks get much closer together further up the chart.


To do this, I need to space those ticks out in a logarithmic / expontial way, so they look something like this (numbers are for illustration purposes only, it's just the line spacing I'm interested in):


enter image description here


I know a little Javascript, so I generated that above image with some code (here's a live editable demo on jsfiddle.net ) using the Raphael framework that draws SVG, which is a format Illustrator can use. So, the worst case scenario is, someone could adapt that code each time, dig into the generated HTML using Firebug or Inspect Element or View Source, find the generated SVG element, copy it into a text editor, save as a .svg file, then open that svg file in Illustrator, then work with it.


But that's hardly convenient or a smooth part of a design workflow. If there's some clever way to do this in Illustrator itself (maybe some smart use of Effect > Distort and transform > Transform with many copies, <100% vertical scale and >0 vertical move?), that would be much better.




Note I'm not particularly interested in any other part of generating a log scale chart in Illustrator. Illustrator's geriatric, creaking Graph tool just doesn't do stuff like that, so I'm more-or-less resigned to copying in something from Excel or similar then adding labels. It's the progressive spacing of the lines I'm interested in.


I've asked a slightly similar question before about graded 'barrelled' spacing of lines, and found an answer that worked for my needs then, but that was about 'barrelling' lines in an approximate visually-controlled way: here I'm asking how to do it in a strictly controlled, accurate way that would match up with something generated on a log scale.




Answer



You are in luck: illustrator supports Javascript (also AppleScript and vb Script).


See http://www.adobe.com/devnet/illustrator/scripting.html for docs.


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...