I'm plotting a 2d heatmap across 3 different conditions (so 3 separate plots), dimensions trials x time. X axis is fixed size across conditions. However each condition has a different number of trials (different number of ticks on the y axis). By default, all my plots across all conditions have the same height, and that's not ideal - i would like the height of the plot to be affected by the number of trials (y axis). That is, I would like to somehow "fix" the distances between ticks on the y axis, so that plots will be different heights depending on the y axis, and the little "rectangles" inside of the plots will be same size as a result. I haven't found any functionality to do that, set_aspect does not quite do the job... Would be so grateful for any info!
for state in states:
# Set plot parameters
plt.figure(figsize=(10, 6)) # Set the figure size
ax = sns.heatmap(heatmap_array, cmap='rocket', cbar=False)
plt.xlabel('Time')
plt.ylabel('Trials')
plt.tight_layout()
# Display the plot
plt.show()