Currently, I am trying to plot a 2D array with imshow and two 1D arrays on separate plots attached to the top and right of the imshow image. I got it to work, however when I change the aspect of the image (which I want to do) white space and unusual scalings appear. I want to get rid of it and have the scales that match the aspect.
Basically, I want to do the same thing shown in the example http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html
attached is the result with out the aspect change.
also attached is the result with aspect change attempt.
here is the code that produces the result above:
import numpy as np
from matplotlib.pyplot import *
import matplotlib as mpl
import matplotlib.cm as cm
fig = figure(figsize=[12.5,7.5])
from mpl_toolkits.axes_grid import make_axes_locatable
#get 3D array from hdf5 file
a = tables.openFile("/Users/magoo/vorpal-data-2/unl-1mm-3d_ElecMultiField_25.h5")
b = a.root.ElecMultiField[ : , : , : ,1]
ax = fig.add_subplot(111)
divider = make_axes_locatable(ax)
axLOutx = divider.new_vertical(1, pad=0.3, sharex=ax)
#plot line above
axLOuty = divider.new_horizontal(2, pad=0.5, sharey=ax)
#plot line on right
yarr = np.arange(0, np.shape(b[:, 75, 75]), 1)
plot image/2D array
im = ax.imshow(b[:,:,75], extent=[0,145,769,0],cmap=cm.jet) # when I add (aspect = .5) as another argument I get what is shown in the second attached image
cb = colorbar(im, fraction=0.015)