Axis coordinates to pixel coordinates? (Matlab)
How can i convert the axis coordinates into pixel coordinates? I have a set of data which include the negative and floating values, i need to put all of the data into the image. But the pixel coordinates are all positive integer. how to solve the negative issue? You can pass vectors of coordinates to scatter . x = [-1.2 -2.4 0.3 7]; y = [2 -1 1 -3]; scatter(x,y,'.'); If you need the image matrix, h = figure(); scatter(x,y); F = getframe(h); img = F.cdata; You can also use print to save the plot to a file (or simply export from figure window), then use imread to read the file. There is also