Note that there are some explanatory texts on larger screens.

plurals
  1. POSet a radial offset on a polar projection in matplotlib
    primarykey
    data
    text
    <p>I have some simulated data in a 2D numpy array with a size like (512, 768).</p> <p>This data is simulated from rmin = 1 to rmax = 100 and phi from 0 to 2pi</p> <p>I try to plot this on a polar plot, but without an offset in radial direction this looks really odd. Note: The images are coming from a radial density distribution, so the plotsshould be radial symmetric.</p> <p><strong>Without xlim/ylim set:</strong></p> <pre><code>fig = plt.figure() ax = fig.add_subplot(111, projection='polar') rho = // 2D numpy array ax.pcolormesh(rho) fig.show() </code></pre> <p><img src="https://i.stack.imgur.com/4Xrwm.png" alt="Radial plot without offset and xlim/ylim"></p> <p><strong>With xlim/ylim set:</strong></p> <pre><code>fig = plt.figure() ax = fig.add_subplot(111, projection='polar') rho = // 2D numpy array print rho.shape ax.axis([x_scale[0], x_scale[-1], y_scale[0], y_scale[-1]]) ax.pcolormesh(rho) fig.show() </code></pre> <p><img src="https://i.stack.imgur.com/NMHJI.png" alt="Radial plot without offset"></p> <p><strong>With a manual axis + X/Y values.</strong></p> <pre><code>fig = plt.figure() ax = fig.add_subplot(111, projection='polar') rho = // 2D numpy array print rho.shape ax.axis([x_scale[0], x_scale[-1], 0, y_scale[-1]]) y_scale_with_offset = np.insert(y_scale, 0, 0) ax.pcolormesh(x_scale, y_scale_with_offset, rho) ax.pcolormesh(rho) </code></pre> <p><img src="https://i.stack.imgur.com/Z8hgK.png" alt="enter image description here"></p> <p>Is there a trick to add a radial offset from 1?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload