0

My question is almost like this question. The difference is that i am wondering how to add the colorbar to each polar plot on a multiple contourf plot and not one for all the plots. I tried it this way :

import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl

dt = 20.0
dist_vec = np.arange(0,901,dt)
azim_vec = np.arange(0,361,dt)
values1 = np.random.random((dist_vec.size,azim_vec.size))
values2 = np.random.random((dist_vec.size,azim_vec.size))
values3 = np.random.random((dist_vec.size,azim_vec.size))

fig, axs = plt.subplots(1, 3, figsize=(12,5),subplot_kw=dict(projection='polar'))
p1 = axs[0].contourf(np.deg2rad(azim_vec),dist_vec, values1, cmap='viridis')
fig.colorbar(p1)
p2 = axs[1].contourf(np.deg2rad(azim_vec),dist_vec, values2, cmap='viridis')
fig.colorbar(p2)
p3 = axs[2].contourf(np.deg2rad(azim_vec),dist_vec, values3, cmap='viridis')
fig.colorbar(p3)
fig.subplots_adjust(left=0.05,right=0.85)
plt.show()

The result is this : enter image description here

What i want it's to add the colorbar of each plot next to it, and of course that all the colorbars and figures are normalized in size.

  • If you just add a colorbar for each axes, the plot will be as desired, I'd say. If that is not the case you need to show the code you have a problem with, not the one that does not even put any colorbar in the plot. – ImportanceOfBeingErnest Mar 12 '18 at 17:12
  • Sorry. I updated it adding the colorbars. The thing is i want each colorbars next to the corresponding plot, and aslo that the all the colorbars and the linked figures are normalized. – Jakes Sevirb Mar 12 '18 at 17:22
  • Did you look at the solutions in the linked question at all? Concerning normalization, did you look how other people normalize their plots? Asking a question here makes sense if you cannot find the solution from previous questions. This just does not seem to be the case here. – ImportanceOfBeingErnest Mar 12 '18 at 17:25

0 Answers0