I have several lists.
HeapSort = {6046.315617631054, 10120.421973039713, 20443.896966227818, 39888.26738991704, 409953.65081967216, 822796.7730263158, 1668210.1566666667, 3417061.523809524, 7231431.842857143, 1.58387906875*10^7, 3.3356646333333332*10^7, 6.99283795*10^7};
InsertSort = {1271.5641210832696, 2687.027971840069, 7428.082168377579, 26163.114593689497, 3480848.111111111, 1.7492152862068966*10^7, 7.876655514285715*10^7, 4.397160115*10^8, 2.19177605*10^9, 9.608922293*10^9, 4.5711371557*10^10, 2.88336011071*10^11};
MergeSort = {705.8025660136586, 757.6872519529326, 712.2989003537274, 712.1736108341547, 1059.3028590671972, 1497.1111723262381, 2410.7281094659293, 4422.600003538069, 10639.153797050876, 21691.320766994926, 45971.68456375839, 91827.67235996327};
QuickSort = {780.2510673824163, 899.0357995655863, 1229.733878841987, 2115.2551030336876, 46303.74590239837, 115050.7630004602, 271829.77228260867, 603560.328106152, 1342529.6916890081, 2965269.349112426, 6622509.02631579, 1.5045565676470589*10^7};
SelectionSort = {1626.7971290340422, 5189.992121652481, 17446.351430565246, 63880.23454266735, 6390999.493670886, 2.6850240684210528*10^7, 1.068697138*10^8, 4.399030115*10^8, 1.784892424*10^9, 7.214766123*10^9, 3.0060269881*10^10, 1.35096492432*10^11};
Num = {10, 25, 50, 100, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000};
They are tests I have performed with different sorting algorithms.
I have the following code to put all of them in a single plot.
ListLinePlot[
{
Table[{Num[[i]], HeapSort[[i]]}, {i, 12}],
Table[{Num[[i]], InsertSort[[i]]}, {i, 12}],
Table[{Num[[i]], MergeSort[[i]]}, {i, 12}],
Table[{Num[[i]], QuickSort[[i]]}, {i, 12}],
Table[{Num[[i]], SelectionSort[[i]]}, {i, 12}]
},
PlotLegend -> {"Heap Sort", "Insertion Sort", "Merge Sort",
"Quick Sort", "Selection Sort"}, LegendPosition -> {1, -0.25},
PlotMarkers -> Automatic,
PlotLabel -> "Average Time of Heap Sort",
AxesLabel -> {"Test Number", "Nano Seconds"},
ImageSize -> Large
]
For some reason, I can't get the plots to show up correctly. The x axis only goes up to around 80000. This is fixed when I remove all but one of the Table lists in the above code.
If you guys could help me debug this code and figure out what's wrong.
PlotRange -> All
option toListLinePlot
help? $\endgroup$ – Vitaliy Kaurov Feb 25 '13 at 0:38PlotRange->All
did help. I actually think I am going to be using the below answer. The graph will turn out much nicer I think. Also, the restart worked out great. I think something got caught up or something. $\endgroup$ – Milo Gertjejansen Feb 25 '13 at 3:39