0

I am trying to have bar chart that has color according to its value. I can get the bar chart and heatmap separate but not together.

as well as CData and vals2colormap. But it didn't work form. Please some help :)

Here are the commands I try to combine:

h = bar(t,retndecm(:,1),"stacked");
l = heatmap(t, retndecm(:,1)','Colormap',jet);
cloned
  • 6,346
  • 4
  • 26
  • 38
Roxana
  • 71
  • 4
  • Is this what you want?https://stackoverflow.com/questions/47149168/trying-to-apply-a-color-map-to-a-bar-graph-in-matlab – Ander Biguri Oct 02 '19 at 10:57
  • Yes that is correct but I can't do that on my dataset. any more help? – Roxana Oct 02 '19 at 11:02
  • 1
    You need to be considerably more specific! Why would a method not be aplicable to your dataset? Can you post a [mcve] showing how you tried and why it does not work, so we can help you fix it? – Ander Biguri Oct 02 '19 at 12:34
  • Thank you, here is what I tried: N = X(1:10,1); h = bar(N, 'hist'); cData = get(h, 'CData'); h.CData(n,:) = rbg; set(h, 'CData', cData); but I want to give different color to the bar chart according to their value/height – Roxana Oct 02 '19 at 13:24
  • 1
    please [edit] your question with the information – Ander Biguri Oct 02 '19 at 13:24
  • I can't edit my question, I am new to this website. can you still help? – Roxana Oct 02 '19 at 13:40
  • Just click on this link: [edit]. It should open the question for editing. Otherwise, just below the tags, it shays "share edit close ...." – Ander Biguri Oct 02 '19 at 13:41

0 Answers0