pcolor and Data Cursor

1 Ansicht (letzte 30 Tage)
Jette
Jette am 24 Sep. 2012
Hi,
I'd like to use the data cursor for pseudo color plots created with pcolor. I wonder how the arrow keys work in this case. If I press the arrow up/down key, the cursor moves one point up/down as I expect it. However, if I press the arrow lft/right keys the cursor seems to jump more diagonal than left/right as I would expect it.
Does anybody know the reason for this? Is there a way to overcome this behaviour and let the cursor move horizontically as well?
Jette
P.S. I'm working with R2010b.

Antworten (1)

Image Analyst
Image Analyst am 24 Sep. 2012
Because the points in pcolor are not the colored tiles like you'd expect - they're the lines. Did you ever notice that you don't have a colored tile for each of your elements? If not, try this
m=magic(4);
pcolor(m); % Shows 3 by 3 array, not a 4x4 array.
I suggest you use image() or imshow() instead of pcolor unless you know for a fact that you want pcolor for some reason and are aware of its quirks.
  1 Kommentar
Jette
Jette am 25 Sep. 2012
Hello Image Analyst,
thanks for your answer. Yes, I know the weird behaviour of pcolor and I've been irritated by this behaviour of not showing the last row and column for years. I have also read several entries in this forum and know that you always suggest to use image or imshow instead of pcolor.
However, I do not work with images but with physical data. I need ways to work with non-equistidistant sampling points and have no clue how to do this using image/imshow. I also find the way image() handles x and y parameters extremely weird because obviously only the minimum and maximum value is used which is quite error-prone in my case.
If you know any workarounds for these issues, I would be thankful to hear them. I have already tried to create a workaround using patch() but have not found a solution yet which solves all my issues.
Jette

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by