I'm trying to make an application in WPF and I want to include a polar heat map such as can be done using matplotlib in Python fairly easily. I.E.
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
plt.subplot(projection='polar')
r = np.linspace(0,1,100) # radius
t = np.linspace(0,2*np.pi, 100) # angle
R, T = np.meshgrid(r,t)
Z = R*R
plt.pcolormesh(T,R,Z)
plt.grid()
plt.thetagrids([theta*45 for theta in range(360//45)])
plt.show()
I'm trying to achieve this using OxyPlot 2.0.0 in C# & XAML, however there is no native support for this as far as I'm aware of. I have tried searching for a solution, and came across this issue in the github repository: https://github.com/oxyplot/oxyplot/issues/911, where PolarColorHeatMapSeries is being mentioned, which would be exactly what I need. However, I'm unable to find how I should implement this. Thus I think I have several options:
- Use the regular heatmap, transform (x,y) to (r,theta) and set pixels out of a certain radius to
double.NaN
. Thereafter, overlay it with an empty polar plot to show polar axes. I have stacked two separate PlotViews. This doesn't feel (and look) right. - Use a canvas and construct this myself. Plot every pixel as a rectangle. However, I'm not sure how I should create the polar axes in this case.
Can anyone give me pointers on where to start this?
Kind regards.