Is it possible to plot a cell array on y axis (imagesc function)

8 visualizzazioni (ultimi 30 giorni)
Hello,
I am plotting a 2D logical vector using imagesc and am trying to specify my y-axis. The information I want to use as my y-axis (names of Action Units) is stored in a 1x42 cell array. When I try to use this information as my y axis I receive the error: Error using set, Conversion to double from cell is not possible.
Is there anyway I can use this information as my y-axis?
Thanks in advance, Shannon
  2 Commenti
Shannon McNee
Shannon McNee il 2 Ago 2016
Modificato: Azzi Abdelmalek il 2 Ago 2016
colormap(gray(256))
>> imagesc(happy)
>> hold on 
>> set(gca, 'XTick', x)
>> hold on 
>> set(gca, 'YTick',{'AU1','AU1-2','AU2','AU2L','AU4','AU5','AU6','AU6L','AU6R','AU7L','AU7R','AU9','AU10Open','AU10LOpen','AU10ROpen','AU11L','AU11R','AU12','AU25-12','AU12L','AU12R','AU13','AU14','AU14L','AU14R','AU15','AU16Open','AU17','AU20','AU20L','AU20R','AU22','AU23','AU24','AU25','AU26','AU27i','AU38','AU39','AU43','AU7','AU12-6'})

This is what I've put in. 'happy' is my 2D logical vector (42x1). I'm extremely new to MATLAB so unsure about what I'm doing wrong.

Accedi per commentare.

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 2 Ago 2016
Use Yticklabel instead of ytick
set(gca, 'YTicklabel',{'AU1','AU1-2','aa' })

Più risposte (0)

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by