Closed TheFermiSea closed 6 days ago
Hi! Can I ask which version of plopp you have? Thanks
With the latest version (24.09.1), as long as I make sure I use autoscale=False
, I can get a polar plot that does not mess up the axes. Example:
import numpy as np
import scipp as sc
import plopp as pp
import matplotlib.pyplot as plt
%matplotlib widget
plt.ioff()
# Make some spiral data
N = 150
r = sc.linspace('r', 0, 10, N, unit='m')
theta = sc.linspace('theta', 0, 12, N, unit='rad')
da = sc.DataArray(data=r * theta, coords={'theta': theta, 'r': r})
# Construct figure axes with Matplotlib
fig, ax = plt.subplots(subplot_kw={'projection': 'polar'})
f = pp.slicer(da, ax=ax, grid=True, autoscale=False)
f.canvas.xrange = 0, 2 * np.pi
f.canvas.yrange = 0, 100
f
However, as soon as I hit the Home button in the toolbar, then the axes do get messed up like you report. I guess polar axes are not so well supported currently...
Hello,
I am trying to use a slicer plot to visualize my data in polar coordinates. It seems that pp.slicer is not setting the theta limits correctly. I have attempted to use p.canvas.xrange = 0., 2*np.pi, but this only sets the theta limits on initialization, which is reset once a slider is changed. I have attempted to inject an update node with no sucess. Here is a MWE:
'''
fig = plt.figure() ax = fig.add_subplot(projection='polar')
p = pp.slicer({'Data':_data, 'Fit':_fit}, keep=['theta'], marker={'Data':'o', 'Fit':''}, linestyle={'Data':'', 'Fit':'-'}, color={'Data':'k', 'Fit':'r'}, autoscale=True, legend=True, ax=ax ) p.canvas.xrange = 0., 2*np.pi p '''
and upon value change:
Please advise