0

I have several numpy arrays, some are identical in shape and intervals so those I want to be plotted vertical, one above another, sharing one colorbar.

So all things should be plotted in one window using subplots.

And I have some numpy arrays varying in intervals, some 1 dimensional matrices, others 5x5 matrices. For those I want one colorbar for each of the array plots. Preferably the 1 dimensional matrices should get a horizontal colorbar, otherwise they would waste height.

Could you provide some example with random initialized numpy arrays?

E.g.:

a_array1 = numpy.random.random( (10, 10) ) # 10x10 matrix
a_array2 = numpy.random.random( (10, 10) ) # 10x10 matrix
a_array3 = numpy.random.random( (10, 10) ) # 10x10 matrix

a_array1 to 3 should be displayed one under another sharing one colorbar.

Things like:

b_array = numpy.random.random(10) # 1x10 "matrix"
c_array = numpy.random.uniform(0.0, 10.0, (5,5))  # 5x5 matrix

b_array should get its own colorbar, preferably horizontal because b_array is one-dimensional.

c_array should get its own colorbar, because its interval is [0.0, 10.0) which differs from the other arrays.

Again all in one window using subplots, because I do not want hundreds of windows but one graphic.

tiago
  • 22,602
  • 12
  • 72
  • 88
daniel451
  • 10,626
  • 19
  • 67
  • 125
  • 2
    First question has its answer here: http://stackoverflow.com/questions/13784201/matplotlib-2-subplots-1-colorbar – Andrey Sobolev Nov 24 '14 at 07:56
  • Closing this as as duplicate, even though it only addresses one part of the question. Please try to keep questions to asking exactly one question, it helps keep the site organized and makes life easier for those answering the questions. You will also get better answers if you have some (partially) working code that you need help with rather than asking for people here to write code for you. – tacaswell Nov 24 '14 at 14:27

0 Answers0