# What is the best way to visualise such data?

So I have 4 algorithms about inserting an element at a position X in some data structure. I did some performance testing for each one of those algorithms. Here are my parameters that I vary.

• The size of my data structure (4 possible values) : 10000, 100000, 500000 and 1000000
• X is the insertion position(4 possible values) : 1,10,100 or 200

For each couple of those parameters (e.g. inserting at a position 1 in a 10000-sized data structure, inserting at a position 10 in a 10000-sized data structure, ..., inserting at a position 200 in a 1000000-sized data structure), I have measured the response time. I did this for each one of the algorithms,

How to represent the data

• In a concise way
• that puts in evidence the difference between the algorithms
• That puts in the difference of performance of a single algorithm across different sizes

My attempt is: Having different graphs, one per each size and then plot the position against the response time of the algorithm. But this doesn't show the difference between a single algorithm across different sizes because different sizes means different plots.

Is there any ideas on how to show this in a smart way? I would appreciate examples. Thanks in advance.

• Do you have just 1 value for each combination (4 algorithms x 4 sizes x 4 positions = 64 values total), or a distribution of values for each combination? And could you insert the plot that you've already made?
– mkt
Jul 4, 2023 at 21:41
• yes, I have one value with each combination of (4 algorithms x 4 sizes x 4 positions = 64 values total). I didn't made the graph on the computer. It's just a sketch on paper where for each size the x-axis i the response time of the algorithm and the y-axis is the insert position.
– user374899
Jul 4, 2023 at 21:55

You could use a facet grid, with a heatmap for each algorithm, crosstabulating size and position and using color for the response time.

In addition, it's possible to add or omit a textual annotation in each cell to show the exact response time, depending on your needs.

Here is an example, with some random values for the response time:

• Thanks for the answer ! I appreciate the idea but I fear that there will be a lot of squares :/
– user374899
Jul 4, 2023 at 22:26
• @BlodyOrange This is an excellent way for you to look at the data and understand the patterns. This example has random numbers but actual data will have some pattern or meaning behind it. Maybe it turns out that the position is almost irrelevant. Maybe in turns out that the response time is just proportion to the size. If you spot something like that you compress the presentation afterwards and show less squares to your audience. Jul 5, 2023 at 7:58

One option is to use a Cleveland dot plot, such as this one from wikipedia:

This example covers a 2 x 2 x 5 case (20 rows total). In your case, 64 rows would be too many to follow this exact format, but you could easily do 4 x 4 in this format (say, algorithm and size). For the third dimension, you could either (i) create 4 panels of the dotplot, or even better, (ii) use 4 different points on the one panel, one for each insertion position. You could use colour [edit: nishua60 makes the reasonable suggestion to vary shape as well] to distinguish between the 4 positions. Here is an example from this page showing how you can use different coloured points on the same row to depict an additional dimension:

• This is very beautiful ! Exactly what I am looking for. Thanks a lot !
– user374899
Jul 4, 2023 at 22:20
• +1. I find it much easier on the eye than my suggestion of using heatmaps. Jul 4, 2023 at 22:24
• @J-J-J Thanks, and +1 to yours too - I was thinking along similar lines initially and still think it might be superior in some conditions though I'm not sure (maybe with 2 crossed dimensions and many categories?)
– mkt
Jul 4, 2023 at 22:31
• Color should never be the sole distinction between/among data series. Color+shape, if you want to go the second route. Jul 5, 2023 at 14:17