# Distribution of User Reputation on Math Stack Exchange

## Background

Recently, I post math on Mathematics Stack Exchange instead of here.

## Problem

How can one get a table for the distribution of reputation on that site?

## Solution

Write a SQL query on Stack Exchange Data Explorer.

The indentation is automatically done by Vim. I know that the syntax is ugly. If I assign text string to the column u.range, then the table is sorted in alphabetical order of that column instead of numerical order. This doesn’t make sense. Therefore, I use a dirty way to get the statistics, and played with the built-in graphing function. However, the visual result isn’t so satisfactory.

Anyone who has completed high school will realise that a log graph is better. Asking for this feature on Meta Stack Exchange takes time. I believe that such feature request will be rejected by the moderator to reduce the workload of Stack Exchange company. Therefore, I plot the log graph using GNU Octave.

2. Change it to an GNU Octave script file.
3. Open it using Vim.
4. Do the necessary text substitutions so that the data becomes a matrix.
5. Complete the script file by adding the plot commands.

I choose loglog because semilogx causes the labels on tail to overlap. Here’s the results.

</source>

## Lessons learnt

I can save plots in GNU Octave as a SVG file. I know this after searching “octave export svg”. From Printing and Saving Plots, I see print -d[device], in which one can substitute the output format. For example, I used print -dsvg to generate the SVG’s shown above.