[Question]
  [
If you've ever tried adding labels to a really dense plot, then you'll realise that sometimes labels will overlap one another, making them hard to read. We're going to do something similar but in 1D.
Input will be a sequence of `(label, x-coordinate)` pairs, and output will be the result of drawing each point and label, in the given order. An asterisk `*` representing the point should be placed at the given x-coordinate and the label should follow. Any existing characters will be overwritten.
For instance, if the input was
```
Hello  0
World  8
Fizz   3
Buzz   5
PPCG   16
X      9
```
Then the following would happen:
```
*Hello
*Hello  *World
*He*Fizz*World
*He*F*Buzzorld
*He*F*Buzzorld  *PPCG  
*He*F*Buz*Xrld  *PPCG
```
The final line should then be outputted.
## I/O rules
* Input may consist of any number of pairs. Each label will only consist of uppercase and lowercase letters, and label lengths will be at most 127 chars. Each x-coordinate will be between 0 and 127 inclusive.
* Input may be in any convenient list or string format such that the pairs are unambiguous and labels/x-coordinates alternate in the input. For example, a format like `[("Hello", 0), ("World", 8) ...]` or `[0 "Hello" 8 "World" ...]` is fine. However, you may not assume two separate lists of labels and x-coordinates.
* Functions and full programs are both okay.
* Any spots not covered by a label should be represented with a space. However, there may not be any extraneous leading or trailing whitespace aside from a single optional trailing newline.
## Examples
**Input:**
```
OneLabel   10
```
**Output:**
```
          *OneLabel
```
**Input:**
```
Heathrow   0
Edinburgh  2
London     4
Liverpool  6
Oxford     8
```
**Output:**
```
*H*E*L*L*Oxfordl
```
**Input:**
```
alpha     20
beta       4
gamma     57
delta      3
epsilon   22
zeta      32
eta       53
theta     27
```
**Output:**
```
   *delta           *a*epsi*thetazeta                *eta*gamma
```
**Input:**
```
abc  5
d    5
abc  10
ABCDEFGHIJKLMNOPQRSTUVWXYZ 127
```
**Output:**
```
     *dbc *abc                                                                                                                 *ABCDEFGHIJKLMNOPQRSTUVWXYZ
```
Note that labels and/or x-coordinates may be repeated.
  
[Answer]
# CJam, ~~24~~ ~~23~~ 19 bytes
```
l~Sf.*'*f*:.{S^+1=}
```
This reads the input as a CJam array of coordinate-label pairs.
Try [this fiddle](http://cjam.aditsu.net/#code=l~Sf.*'*f*%3A.%7BS%5E%2B1%3D%7D&input=%5B%5B20%20%22alpha%22%5D%20%5B4%20%22beta%22%5D%20%5B57%20%22gamma%22%5D%20%5B3%20%22delta%22%5D%20%5B22%20%22epsilon%22%5D%20%5B32%20%22zeta%22%5D%20%5B53%20%22eta%22%5D%20%5B27%20%22theta%22%5D%5D) in the CJam interpreter or [verify all test cases at once.](http://cjam.aditsu.net/#code=qN%2F%7B%0A%20%20L~Sf.*'*f*%3A.%7BS%5E%2B1%3D%7D%0AN%7DfL&input=%5B%5B10%20%22OneLabel%22%5D%5D%0A%5B%5B0%20%22Heathrow%22%5D%20%5B2%20%22Edinburgh%22%5D%20%5B4%20%22London%22%5D%20%5B6%20%22Liverpool%22%5D%20%5B8%20%22Oxford%22%5D%5D%0A%5B%5B20%20%22alpha%22%5D%20%5B4%20%22beta%22%5D%20%5B57%20%22gamma%22%5D%20%5B3%20%22delta%22%5D%20%5B22%20%22epsilon%22%5D%20%5B32%20%22zeta%22%5D%20%5B53%20%22eta%22%5D%20%5B27%20%22theta%22%5D%5D%0A%5B%5B5%20%22abc%22%5D%20%5B5%20%22d%22%5D%20%5B10%20%22abc%22%5D%20%5B127%20%22ABCDEFGHIJKLMNOPQRSTUVWXYZ%22%5D%5D)
*Thanks to @MartinBüttner for helping me save 4 bytes!*
### How it works
```
l~                   Read a line from STDIN and evaluate it.
  Sf                 For each pair, push the pair and " "; then:
    .*                 Perform vectorized repetition.
                         [X "label"] " " .* -> [(X spaces) "label"]
      '*f*           Join each resulting pair, using '*' as separator.
          :.{     }  Reduce by the following vectorized operator:
                       Push two characters (A and B).
             S^        Compute the symmetric difference of B and " ".
                       This pushes "B " for a non-space B and "" otherwise.
                +1=    Append and select the second character (with wrap).
                       This selects B for "AB " and A for "A".
```
[Answer]
## Python 2, 67 bytes
```
z=''
for a,b in input():z=(z+' '*b)[:b]+'*'+a+z[len(a)-~b:]
print z
```
Takes input like `[('Heathrow', 0), ('Edinburgh', 2), ('London', 4), ('Liverpool', 6), ('Oxford', 8)]` and prints the result.
Python doesn't allow strings to be modified, and converting to and from a list is expensive. So, this recreates the string `z` to add in a new word. We take the `b` characters before the word, padding with spaces if needed, then the new text with an asterisk, then the part of `z` after the new word. Note that trailing spaces are never added.
The `reduce` version is 3 chars longer (70):
```
lambda I:reduce(lambda z,(a,b):(z+' '*b)[:b]+'*'+a+z[len(a)-~b:],I,"")
```
[Answer]
# Pyth, 20 bytes
```
V.Tmrj" *"d9Qpe+d-Nd
```
Try it online: [Demonstration](http://pyth.herokuapp.com/?input=%5B0%2C%20%22Hello%22%5D%2C%20%5B8%2C%20%22World%22%5D%2C%20%5B3%2C%20%22Fizz%22%5D%2C%20%5B5%2C%20%22Buzz%22%5D%2C%20%5B16%2C%20%22PPCG%22%5D%2C%20%5B9%2C%20%22X%22%5D%0A%2AHe%2AF%2ABuz%2AXrld%20%20%2APPCG&test_suite_input=%5B%5B0%2C%20%27Hello%27%5D%2C%20%5B8%2C%20%27World%27%5D%2C%20%5B3%2C%20%27Fizz%27%5D%2C%20%5B5%2C%20%27Buzz%27%5D%2C%20%5B16%2C%20%27PPCG%27%5D%2C%20%5B9%2C%20%27X%27%5D%5D%0A%5B%5B10%2C%20%27OneLabel%27%5D%5D%0A%5B%5B0%2C%20%27Heathrow%27%5D%2C%20%5B2%2C%20%27Edinburgh%27%5D%2C%20%5B4%2C%20%27London%27%5D%2C%20%5B6%2C%20%27Liverpool%27%5D%2C%20%5B8%2C%20%27Oxford%27%5D%5D%0A%5B%5B20%2C%20%27alpha%27%5D%2C%20%5B4%2C%20%27beta%27%5D%2C%20%5B57%2C%20%27gamma%27%5D%2C%20%5B3%2C%20%27delta%27%5D%2C%20%5B22%2C%20%27epsilon%27%5D%2C%20%5B32%2C%20%27zeta%27%5D%2C%20%5B53%2C%20%27eta%27%5D%2C%20%5B27%2C%20%27theta%27%5D%5D%0A%5B%5B5%2C%20%27abc%27%5D%2C%20%5B5%2C%20%27d%27%5D%2C%20%5B10%2C%20%27abc%27%5D%2C%20%5B127%2C%20%27ABCDEFGHIJKLMNOPQRSTUVWXYZ%27%5D%5D&code=V.Tmrj%22%20%2A%22d9Qpe%2Bd-Nd&test_suite=0) or [Test Suite](http://pyth.herokuapp.com/?input=%5B0%2C%20%22Hello%22%5D%2C%20%5B8%2C%20%22World%22%5D%2C%20%5B3%2C%20%22Fizz%22%5D%2C%20%5B5%2C%20%22Buzz%22%5D%2C%20%5B16%2C%20%22PPCG%22%5D%2C%20%5B9%2C%20%22X%22%5D%0A%2AHe%2AF%2ABuz%2AXrld%20%20%2APPCG&test_suite_input=%5B%5B0%2C%20%27Hello%27%5D%2C%20%5B8%2C%20%27World%27%5D%2C%20%5B3%2C%20%27Fizz%27%5D%2C%20%5B5%2C%20%27Buzz%27%5D%2C%20%5B16%2C%20%27PPCG%27%5D%2C%20%5B9%2C%20%27X%27%5D%5D%0A%5B%5B10%2C%20%27OneLabel%27%5D%5D%0A%5B%5B0%2C%20%27Heathrow%27%5D%2C%20%5B2%2C%20%27Edinburgh%27%5D%2C%20%5B4%2C%20%27London%27%5D%2C%20%5B6%2C%20%27Liverpool%27%5D%2C%20%5B8%2C%20%27Oxford%27%5D%5D%0A%5B%5B20%2C%20%27alpha%27%5D%2C%20%5B4%2C%20%27beta%27%5D%2C%20%5B57%2C%20%27gamma%27%5D%2C%20%5B3%2C%20%27delta%27%5D%2C%20%5B22%2C%20%27epsilon%27%5D%2C%20%5B32%2C%20%27zeta%27%5D%2C%20%5B53%2C%20%27eta%27%5D%2C%20%5B27%2C%20%27theta%27%5D%5D%0A%5B%5B5%2C%20%27abc%27%5D%2C%20%5B5%2C%20%27d%27%5D%2C%20%5B10%2C%20%27abc%27%5D%2C%20%5B127%2C%20%27ABCDEFGHIJKLMNOPQRSTUVWXYZ%27%5D%5D&code=V.Tmrj%22%20%2A%22d9Qpe%2Bd-Nd&test_suite=1)
### Explanation
```
V.Tmrj" *"d9Qpe+d-Nd
   m        Q         map each pair d of the input to:
     j" *"d             join d by the string " *"
    r      9            range-length encode 
                        (this gives x-coordinate spaces, a star and the label)
 .T                   transpose this table 
V                     for N in ^:
                 -Nd    remove spaces from N
               +d       add a space at the beginning
              e         take the last character
             p          and print it (without newline)
```
[Answer]
# JavaScript ES6, 104 bytes
```
c=>(a=Array(255).fill(" "))&&c.map(([u,v])=>a.splice(u,v.length+1,..."*"+v))&&a.join``.replace(/ +$/,"")
```
## Example Usage
Input into a compliant console:
```
t = [[0,"Hello"],[8,"World"],[3,"Fizz"],[5,"Buzz"],[16,"PPCG"],[9,"X"]];
(c=>(a=Array(255).fill(" "))&&c.map(([u,v])=>a.splice(u,v.length+1,..."*"+v))&&a.join``.replace(/ +$/,""))(t);
```
Output from the last statement:
```
"*He*F*Buz*Xrld  *PPCG"
```
## Explanation
This creates an anonymous function from `c` to three expressions that have been logically-ANDed together. The first two statements are always truthy, and the JS short-circuit rules say that whenever the first is truthy, return the entire value on the right hand side (without coercing to boolean): so this is formally equivalent to
```
(function (c) {
    a = Array(255).fill(" ");                    // global variable `a` overwritten
    c.map(function (x) {                         // only side-effects are used here.
       var u = x[0], v = x[1];                   // ES6 destructuring
       a.splice(u, v.length + 1, ..."*" + v));   // main logic
    });
    return a.join("").replace(/ +$/, "");        // postprocessing and trim
})
```
The first statement has to be wrapped in parentheses above because the assignment operator `=` has lower precedence than the logical-AND operator `&&`.
The "rest parameter" assembly `..."*"+v` is also part of ES6; it concatenates a leading `*` to the string and then interprets it as a list-like parameter, splitting it into a bunch of arguments which are provided to `Array.prototype.splice`, which takes `(m, n, ...rest)` and modifies its array at position `m` to remove `n` elements and then insert all of the `rest` arguments. To accomplish this before ES6 you would use the more cumbersome:
```
[].slice.apply(a, [u, v.length + 1].concat(("*" + v).split("")))
```
The array then gets concatenated with the empty string and trailing whitespace is deleted.
[Answer]
# Ruby, ~~94~~ ~~81~~ 75 bytes
Golfed:
```
s=" "*128;$<.map{|l|w,p=l.split;p=p.to_i;s[p..w.size+p]="*"+w};$><<s.rstrip
```
Here's the ungolfed code:
```
s = " "*128
$<.map{|l|                 # for each line entered via stdin, ctrl+D to stop
  w,p = l.split            # had to move the chomp down here
  p = p.to_i               # there's no 'to_i!'...
  s[p..w.size+p] = "*"+w   # in the range of *foobar, replace the string
}
$><<s.rstrip               # output suggested by w0lf
```
Thanks @w0lf for the suggestions on mapping the input!
Thanks @w0lf and @Not that Charles for the thought on removing a variable.
[Answer]
# Javascript 121 chars
Using non-standard features, works on Firefox.  
`x=Array(255).fill(" ");eval(prompt()).map(s=>{s[0].split``.map((n,i)=>x[s[1]+i+1]=n);x[s[1]]="*"});x=x.join``.trimRight()`
Older version:
`x=Array(255).fill(" ");eval(prompt()).map(s=>{s[0].split``.map((n,i)=>x[s[1]+i+1]=n);x[s[1]]="*"});x=x.join``.replace(/ +$/,"")`
```
x=Array(255).fill(" ");      //Creates an array with spaces
eval(prompt())               //Gets some input, has to look like [["Hello",4],["Hi",14],["Oi",0]]
.map(s=>{s[0].split``.map((n,i)=>x[s[1]+i+1]=n);x[s[1]]="*"}); //Main "logic"
x=x.join``.replace(/ +$/,"") //Gets rid of the trailing spaces
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 14 bytes
```
0x;”*;µ/€Ṛo/o⁶
```
[Try it online!](https://tio.run/##vZHNTsJAEMfP9CmaenJCwpf4EU6CfKhV8BOw6WFLV1qzdEkFRU7qxXcw8Q28auJVn0RepM5u64IePDpNmvz@Ozvz35kLythNFGUnpdntE5TeXzKz@@fPt0ee4bO71@jjYbkbRZaWsqxsWjcamM0NO61b60htHjJXUgGp5k@nEooI5XECuVWkVqtSl7SB0DFsO62llnQDGhRqgKnQwUK6DjJPE81yolszoCZxKFMXdBWgzrS5NzLyQn4tG@VRqLp@4IzDvieVFVRMHrg8kChsmf4VDYecM/Wi5uSch@6CQaiCiV@sJ83yohthQ4@owg4dxVBcQ@qTwYCoubiUJYd54YoOL32WmCgIYaruiuwYtBRmi1IjTwrz94Mspy9MgoAoCTJT1NJ/BaAGsSVpX6yHOD21qniDcuDfck723ixXtqq1emN7Z9fc22@2Dg6Pjk9O253u2c@FgOv00Ab@/jvgD4ua/QU "Jelly – Try It Online")
Takes input as a list of pairs `[coordinate, label]`. The last test case does work, TIO simply has wrapping
## How it works
```
0x;”*;µ/€Ṛo/o⁶ - Main link. Takes a list of pairs I
        €      - Over each pair P in I:
      µ        -   Run the following, using:
       /       -     C (coord) as the left argument and L (label) as the right:
0x             -       Repeat 0 C times
  ;”*          -       Concatenate "*"
     ;         -       Append L
         Ṛ     - Reverse I
          o/   - Reduce columnwise by logical OR
                 This replaces 0s with the next non-zero element
            o⁶ - Replace the remaining zeros with spaces
```
[Answer]
## Python, 85 bytes
```
def g(p):
 z=[' ']*256
 for a,b in p:z[b:b+len(a)+1]='*'+a
 return''.join(z).rstrip()
```
[Try it online](http://ideone.com/5TRBSW)
[Answer]
## Perl, 66 bytes
**63 bytes script + 3 bytes for `-p`**
```
$}||=$"x128;/\s+/,substr$},$',1+length$`,"*$`"}{$_=$};s/\s+$/
/
```
Nothing too special, utilising the variables `$`` and `$'` which are 'before the match' and 'after the match' respectively, instead of splitting the string. I used a `$}` for the string variable as originally it was saving me a byte, but isn't any more!
### Example run:
```
$perl -p overwritlabels.pl <<< 'Hello  0
World  8
Fizz   3
Buzz   5
PPCG   16
X      9'
*He*F*Buz*Xrld  *PPCG
```
---
## Perl, 65 bytes
**62 bytes script + 3 bytes for `-p`**
Another version that prints out each line (for one less byte!). (Yes, I made this because I didn't read the question properly...)
```
$}||=$"x128;/\s+/;substr$},$',1+length$`,"*$`";$_=$};s/\s+$/
/
```
### Example run:
```
$perl -p overwritlabels.pl <<< 'Hello  0
World  8
Fizz   3
Buzz   5
PPCG   16
X      9'
*Hello
*Hello  *World
*He*Fizz*World
*He*F*Buzzorld
*He*F*Buzzorld  *PPCG
*He*F*Buz*Xrld  *PPCG
```
[Answer]
# PHP -- 84 bytes
```
<? foreach(array_chunk(array_slice($argv,1),2) as $p) echo "␣[".($p[1]+1)."G*$p[0]";
                                                            ^ ESC character (\x1b)
```
Uses ANSI escape codes to position the cursor (`\x1b[XG`, featuring the Escape character and X being the 1-based coordinate), followed by the `*` then the input string for that row. Accepts input on the command line of the form:
```
php filename.php Heathrow 0 Edinburgh 2 London 4 Liverpool 6 Oxford 8
php filename.php abc 5 d 5 abc 10 ABCDEFGHIJKLMNOPQRSTUVWXYZ 127
```
Accepts multi-word entries if they're in quotes, since they're command line arguments.
[Answer]
# C++11, 95 bytes
Why not?
As a function, receive input as a `map<int, string>` named `v` containing the position and the string.
```
string t(255,' ');for(auto&m:v){int i=m.first;t[i++]='*';for(auto&c:m.second)t[i++]=c;}cout<<t;
```
Usage
```
#include <iostream>
#include <map>
using namespace std;
int main(){
    map<int,string> v{{0,"Heathrow"},{2,"Edinburgh"},{4,"London"},{6,"Liverpool"},{8,"Oxford"}};
    string t(255,' ');for(auto&m:v){int i=m.first;t[i++]='*';for(auto&c:m.second)t[i++]=c;}cout<<t;
}
```
[Check it Running Here](https://ideone.com/dLZUuw)
[Answer]
# [Husk](https://github.com/barbuz/Husk), 13 bytes
```
Fż|mF(J'*eR' 
```
[Try it online!](https://tio.run/##yygtzv7/3@3onppcNw0vda3UIHWF////R2sY6Ch5pObk5Ctp6mhY6CiF5xflpIDYxjpKbplVVSCmqY6SUymEaWimoxQQ4OwOYlvqKEUoacYCAA "Husk – Try It Online")
Takes a list of pairs (coordinate, label) as input. N.B.: there is a space character at the end of the code.
### Explanation
```
Fż|mF(J'*eR' 
   m             For each pair in the input
    F            apply the following function using the pair members as arguments
          R'     Repeat a space (coord) time
         e       put this in a list with the label
      J'*        and join the strings in the list with "*"
F                Fold over the resulting list
 ż               by zipping strings together 
                   (keeping extra characters in the longer string unchanged) 
  |              with OR (Second argument if truthy else first. Spaces in Husk are falsy)
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 18 bytes
```
rÈh'*+YÎYÌ}Sp#ÿ)x1
```
[Try it online!](https://tio.run/##y0osKPn/v@hwR4a6lnbk4b7Iwz21wQXKh/drVhj@/x8dreSRmpOTr6RjEKsTrRSeX5SToqRjAWK7ZVZVKekYg5hOpSCmKYgZEODsrqRjaAZiRyjpWMbGAgA "Japt – Try It Online")
Takes input as an array of `[label, x-coordinate]`
Explanation:
```
rÈh'*+YÎYÌ}Sp#ÿ)x1    #
           Sp#ÿ       # Store 255 spaces as X
r         }    )      # Do this for each pair in order:
 Èh                   #  Overwrite part of X:
        YÌ            #   Starting at index equal to the second item of the pair
   '*                 #   Write "*"
     +YÎ              #   Write the first item of the pair
                x1    # Remove any remaining whitespace on the right side
```
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), 9 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
Ｈ｛｝０┘*；＋╋
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXVGRjI4JXVGRjVCJXVGRjVEJXVGRjEwJXUyNTE4KiV1RkYxQiV1RkYwQiV1MjU0Qg__,i=JTVCJTVCJTIySGVsbG8lMjIlMkMwJTVEJTJDJTVCJTIyV29ybGQlMjIlMkM4JTVEJTJDJTVCJTIyRml6eiUyMiUyQzMlNUQlMkMlNUIlMjJCdXp6JTIyJTJDNSU1RCUyQyU1QiUyMlBQQ0clMjIlMkMxNiU1RCUyQyU1QiUyMlglMjIlMkM5JTVEJTVE,v=8)
Same as my Stax answer, except canvas is better at grid overlaps.
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), 29 bytes
```
~""\{~." "*3$\+<"*"+\+.,@>+}/
```
[Try it online!](https://tio.run/##HctBDsIgEIXhq5AXV8VUAzbdGOM9gAUqtk2oJZaVxl4dmdl9f2besMTnen9PKZeyAfa7tRBo9M7KMxpIK9v99SJ/h1KMgY9p9BDq6ITBLeTqE3Hw81zd9RSPEOmgySGtU1xedaIoPzzRbGbHX3nkUL1zfw "GolfScript – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), ~~11~~ 8 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
┤6╧ß╡⌠░$
```
[Run and debug it](https://staxlang.xyz/#p=b436cfe1b5f4b024&i=%5B%5B0,+%22Hello%22%5D,+%5B8,+%22World%22%5D,+%5B3,+%22Fizz%22%5D,+%5B5,+%22Buzz%22%5D,+%5B16,+%22PPCG%22%5D,+%5B9,+%22X%22%5D%5D%0A%5B%5B10,+%22OneLabel%22%5D%5D%0A%5B%5B0,+%22Heathrow%22%5D,+%5B2,+%22Edinburgh%22%5D,+%5B4,+%22London%22%5D,+%5B6,+%22Liverpool%22%5D,+%5B8,+%22Oxford%22%5D%5D%0A%5B%5B20,+%22alpha%22%5D,+%5B4,+%22beta%22%5D,+%5B57,+%22gamma%22%5D,+%5B3,+%22delta%22%5D,+%5B22,+%22epsilon%22%5D,+%5B32,+%22zeta%22%5D,+%5B53,+%22eta%22%5D,%5B27,+%22theta%22%5D%5D%0A%5B%5B5,+%22abc%22%5D,+%5B5,+%22d%22%5D,+%5B10,+%22abc%22%5D,+%5B127,+%22ABCDEFGHIJKLMNOPQRSTUVWXYZ%22%5D%5D&m=2)
Takes input as a list of pairs `[coordinate, label]`. Thanks to caird coinheringaahing for the testcases.
## Explanation
```
zsFE'*s+|%
zs            push empty list and swap with the input
  F           for each element,
   E          push each item onto stack
    '*s+      add asterisk to label
              Stack: [index,label]
        |%    embed in the array
```
]