Question: Hey guys i have been making a game in which a user presses a button and every time he presses that button, the screens adds a new UIImageView (which is the same every time). These UIImageViews are separately draggable with the UITouch function. But i want them to detect a intersection as well!
And i want to know which two UIImageViews intersected so i can change the image-url of the two UIImageViews which are intersected.

```
-(IBAction)ClTouched:(id)sender {

imgView2 = [[UIImageView alloc] initWithFrame:CGRectMake(120, 20, 80, 80)];
imgView2.backgroundColor = [UIColor clearColor];
imgView2.userInteractionEnabled = TRUE;
imgView2.image = [UIImage imageNamed:@"Cl.png"];

[self.view addSubview:imgView2];

```

}

// To Move image with touch You can 
- (void)touchesMoved:(NSSet \*)touches withEvent:(UIEvent \*)event 
{
 imgView.userInteractionEnabled = TRUE;

```
// get touch event
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchLocation = [touch locationInView:self.view];

if ([self.view.subviews containsObject:[touch view]]) {
    [touch view].center = touchLocation;
}

if (CGRectIntersectsRect(imgView.frame, imgView2.frame)) {
    naam.text = @"INTERSECTION";
}

```

}

I hope this is enough information to help me out!

Answer: 
pm3d is not the same as "plot ... with image", so the workaround is maybe not the best solution. It seems, that gnuplot sets the tics automatically to the background, when you use the "with image" option, so

```
set tics front

```

should solve the problem (At least it did in my case).
I worked around this issue by setting `set pm3d map` and using `splot` instead of plot. The second plot (which is a 2D plot) needs a dummy `Z` value so I repeated a column.

Finally, the working code looks like this:

```
set term postscript portrait color
set output 'output.ps'
set pm3d map
splot 'data_file' using 1:2:3 with image, 'data_file2' using 1:2:2 with lines

```