- Be careful: XData and YData correspond to coordinates of the centers of the boundary pixels, not to the edges. You need to allow space for half a pixel relative to the coordinates given
- With high enough resolution displays, on Windows MATLAB maps 100 "pixels" to 1 inch, and on Mac MATLAB maps 72 "pixels" to 1 inch. Determining the correct adjustment for physical pixels can be a nuisance.
- data pixels cannot be different sizes when this is used. If you need data pixels to be different sizes, see warp()
Assign colour to grid cells of arbitrary length given the index of the cell
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi i am trying to recreate the following image, in this image each grid is a 2x2 square and the color represents the probability of occupancy.
I have the index of the cell corner example matrix c = [1 1; 2 3; 4 5] and values corresponding to those cells logprob = [0.5, 0.3, 0.8]
I have tried using imagesc still i am not able to apply it to achieve the desired result, since it doesn't have a cell width property. any help is greatly appreciated thank you.
1 Commento
Walter Roberson
il 4 Set 2020
You can pass XData and YData properties to imagesc() in order to control the positions of the data pixels in data coordinates. By careful choice of axes Position and axes Units properties, and using the XData and YData properties, you can control the exact number of pixels that an image will take on the display.
However:
... But I suspect that is not what you are talking about. I suspect what you are looking for is painting the grid. "grid on", and look at XTicks and XMinorTicks to control grid locations.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Mapping in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!