title: Linear X Logarithmic scale
body: <p>Given a line <code>X</code> pixels long like:</p>
  
  <blockquote>
  <pre><code>0-------|---V---|-------|-------|-------max
  </code></pre>
  </blockquote>
  
  <p>If <code>0 &lt;= V &lt;= max</code>, in linear scale <code>V</code> position would be <code>X/max*V</code> pixels.</p>
  
  <p>How can I calculate the pixel position for a logarithmic scale, and starting from the pixel position how can I get back the value of V?</p>
  
  <ol>
  <li>It is not homework</li>
  <li>I want to know the math (no "use FOO-plotlib" comments, please)</li>
  <li>I like Python</li>
  </ol>
  
  <p>A logarithmic scale has the effect of "zooming" the left side of the scale. Is it possible to do the same thing for the right side instead?</p>
  
  <p>[UPDATE]</p>
  
  <p>Thanks for the math lessons!</p>
  
  <p>I ended up not using logarithms. I've simply used the average value (in a set of values) as the center of the scale. This control is used to select group boundary percentiles for a set of values that will be used to draw a <a href="http://en.wikipedia.org/wiki/Choropleth_map" rel="noreferrer">choropleth chart</a>.</p>
  
  <p>If the user chooses a symmetric scale (red mark=average, green mark=center, darkness represents the number of occurrences of a value):
  <img src="https://i.stack.imgur.com/73Umv.png" alt="enter image description here"></p>
  
  <p>An asymmetric scale makes fine-grained adjustments easier:
  <img src="https://i.stack.imgur.com/OTcVD.png" alt="enter image description here"></p>