0

I have data in the following form: % (Percentage) of agent_i having their percentage contribution at some time points:

time    1     2     3     4     5     6     7     8 .....  200
400:   5.2  6.4   0.7   1.56  11.4  ...   ...   ...        ...
...
...
...     
20000: 0.01 0.3   87.4   4.1  7.4   ...   ...   ...        ...

I have visualized this data as a MATLAB 'running plot' with graph evolving over time, and plotting % of each agent at each time. This gives me a video. However, I also need to have a static representation, that can be printed on paper. Thus, one figure representing this data. I've thought of making vertical bars for each time-point, with bars having stripes of different (or alternating) colors with size of the stripe corresponding to the %. This, way I lose the data of which agent has that percentage, but that can be accepted, and this is something that I can afford to lose while putting all information in a single figure.

However, colormap doesn't really help since it just colors bar stacks according to their value. I, however, want stacks of alternating colors. (and use just 2, or maximum 3 colors)

Can somebody help?

Prateek
  • 41
  • 1
  • 5
  • what about a 3d plot like this one: http://www.originlab.com/www/resources/graph_gallery/images_galleries/Choe_as_3D_Waterfall_500px.gif? – Ander Biguri Feb 16 '15 at 15:04
  • Thank you, I tried that, but it doesn't really work well. Can you tell me the answer to the part in bold above? – Prateek Feb 18 '15 at 12:33
  • 1
    You can create your own colormaps easily. There are seeral questions about that in SO such as: http://stackoverflow.com/questions/24630132/matlab-custom-colormap-with-only-3-colors . You can also creata a colormap where 3 colours are more strong and the transition is no that long, such as: http://stackoverflow.com/questions/24488378/how-to-map-a-specific-value-into-rgb-color-code-in-matlab/24488819#24488819 – Ander Biguri Feb 18 '15 at 12:42
  • @prateek: Can you give an example of what you'd like the stacked bars to look like? – Jonas Feb 18 '15 at 13:40

1 Answers1

1

I would present the data as an image, where every pixel's brightness indicates the agent's contribution:

imagesc(data)
caxis([min(data(:)), max(data(:))])
colormap('gray')
Jonas
  • 74,690
  • 10
  • 137
  • 177
  • I'll try that. Can you tell me the answer to the part in bold above? – Prateek Feb 18 '15 at 12:34
  • 1
    @Prateek - Yes. Use a `colormap` with a reduced amount of levels. Ander Biguri gave you some nice links to tell you how to do that in his comment to you above. – rayryeng Feb 19 '15 at 16:21