# Set a correct scale for a logarithmic graph

I generated a graph from a CSV data which represents T(n), that is, the time taken - in milliseconds - to execute a sort task as the data n increases. The graph generated can see below:

I generated it with this code (assuming merge is a list of pairs of numbers):

ListLinePlot[merge, PlotRange->All, AxesLabel->{"tamanho entrada(n)", "tempo(ms)"}


My question is: how to put evidence to the fact that the growing time is actually n*log(n) instead of a linear time, as can be misleading by looking at the line of the graph?

Also worth noting that my data looks like this: {{data,time},{10,0},{20,0},{30,0},{40,0},{50,0},{60,0},{70,0},{80,0},{90,0},{100,0}}...

• ListLogPlot maybe? – AccidentalFourierTransform May 5 '18 at 23:43
• Perfect! How could I have missed that? I thought that such function didn't exist and I went directly to the LogPlot. – Rafael Campos Nunes May 5 '18 at 23:45
• Well, it's not perfect because the scale is logarithmic, not linearithmic. But perhaps it's good enough for you. Cheers! – AccidentalFourierTransform May 5 '18 at 23:48
• Yes, all the sort methods I'm dealing with are linear arithmetic, but, it does shows the correct behavior of the algorithm at a glance on the graph. – Rafael Campos Nunes May 5 '18 at 23:50

## 1 Answer

The almost correct function in Mathematica to display this graph with that kind of data is to use as already mentioned by AccidentalFourierTransform ListLogPlot.

After the use of the function the graph looks better, although not linear arithmetic it serve my purposes with few adjustments.

The code used to generate such graph is:

ListLogPlot[merge, Joined->True]

• Note also ListLogLogPlot and ListLogLinearPlot. – AccidentalFourierTransform May 5 '18 at 23:56
• Worth mentioning as well. Thanks again! – Rafael Campos Nunes May 5 '18 at 23:59