Plotted data changes when applying custom colormap
Question:
I am working with a very specific custom color map, that i apply to a matrix using imagesc(). When plotting my data with a built in colormap, everything plots as expected. When im using my own colormap, the image itself plots and the colormap works wonderfully. However: The y-coordinates of my matrix shift! The x coordinates are unaffected by this. Everything is plotted within the same figure, the only difference between the figures is the colormap() command. I hope this is a well known problem, however my internet search didnt resolve the issue.
Thanks in advance for anyone who answers!
Appendix:
Plot with built in colormap: Note that the top-right most pixel of my data is at [30, 60]
imagesc(Vertical_Time_Matrix);
Plot with my Colormap: Note that the top-right most pixel of my data is at [30, 78]
imagesc(Vertical_Time_Matrix);
colormap(myColormap);
A few words regarding my colormap and the data. The data is a 220×30 matrix containing numbers ("States") from 1-28. Depending on the state a color is chosen from a color map. Hence, the colormap is 28 entries long.Question:
I am working with a very specific custom color map, that i apply to a matrix using imagesc(). When plotting my data with a built in colormap, everything plots as expected. When im using my own colormap, the image itself plots and the colormap works wonderfully. However: The y-coordinates of my matrix shift! The x coordinates are unaffected by this. Everything is plotted within the same figure, the only difference between the figures is the colormap() command. I hope this is a well known problem, however my internet search didnt resolve the issue.
Thanks in advance for anyone who answers!
Appendix:
Plot with built in colormap: Note that the top-right most pixel of my data is at [30, 60]
imagesc(Vertical_Time_Matrix);
Plot with my Colormap: Note that the top-right most pixel of my data is at [30, 78]
imagesc(Vertical_Time_Matrix);
colormap(myColormap);
A few words regarding my colormap and the data. The data is a 220×30 matrix containing numbers ("States") from 1-28. Depending on the state a color is chosen from a color map. Hence, the colormap is 28 entries long. Question:
I am working with a very specific custom color map, that i apply to a matrix using imagesc(). When plotting my data with a built in colormap, everything plots as expected. When im using my own colormap, the image itself plots and the colormap works wonderfully. However: The y-coordinates of my matrix shift! The x coordinates are unaffected by this. Everything is plotted within the same figure, the only difference between the figures is the colormap() command. I hope this is a well known problem, however my internet search didnt resolve the issue.
Thanks in advance for anyone who answers!
Appendix:
Plot with built in colormap: Note that the top-right most pixel of my data is at [30, 60]
imagesc(Vertical_Time_Matrix);
Plot with my Colormap: Note that the top-right most pixel of my data is at [30, 78]
imagesc(Vertical_Time_Matrix);
colormap(myColormap);
A few words regarding my colormap and the data. The data is a 220×30 matrix containing numbers ("States") from 1-28. Depending on the state a color is chosen from a color map. Hence, the colormap is 28 entries long. colormap, figure MATLAB Answers — New Questions