Closed carleyjmartin closed 1 year ago
import matplotlib.pyplot as plt #verified to 3.7.1
import pydarn
file = "test/data/20150317.0900.32.sas.fitacf.bz2"
SDarn_read = pydarn.SuperDARNRead().read_dmap(file)
ax, _,_,_,_ = pydarn.Fan.plot_fan(SDarn_read, parameter='elv', coastline=True, lowlat=60)
plt.show()
Here's the output that I got.
Thanks @PrestonXPitzer !
I just want to check that you installed this branch of pydarn using (apologies, I did not go over this in the tutorial and I should have):
pip3 install git+https://github.com/superdarn/pydarn@fix/fan-plot-grid
or by cloning
git clone https://github.com/SuperDARN/pydarn.git
checking out this branch cd pydarn
git checkout fix/fan-plot-grid
and then installing pip3 install .
I'm struggling to recreate the grid lines not showing up now.
I tried both of these methods a few times, and I'm getting the same output; No grid lines (Using the code I sent before). I have an example of grid lines working for me on main if that helps.
#generate individual fan plots for each time period
plot_output = pydarn.Fan.plot_fan(data_list[position], fov_color='grey', line_color='blue',
radar_label=True, colorbar = False,
coords=pydarn.Coords.AACGM_MLT, coastline=True)
ax=plot_output[0]
pydarn.Fan.plot_fan(rkn_data_list[position], fov_color='grey', line_color='red',radar_label=True,
groundscatter=True, colorbar_label="Velocity (m/s)", ax=ax,
coords=pydarn.Coords.AACGM_MLT, coastline=True)
plt.savefig('stpatricksday_fanplot_' + str(iter) + '.png', dpi = 300)
iter+=1
Awesome, thanks! I'll look into it more!
Okay, so if I just straight up remove the grid call in projections. It appears to still plot the grid lines for me so hopefully fixed?
It is working for me.
This was solved in #339
Scope
This PR fixes a bug where the plot grid lines on fan plots were not showing up. I have removed duplicate code that seems to mess up the grid plotting and added a zorder to the ax.grid() to give it a position on the plot. Zordering was added with the map plots but not checked against the fan plots.
issue: No issue
Approval
Number of approvals: 1 quick fix
Test
matplotlib version: 3.7.1 Note testers: please indicate what version of matplotlib you are using
If you get a chance have a look at map plots to make sure the grid lines are where you expect.