-
Hi, I recently started using xarray in my work and came across this issue where after defining the coordinate labels for my dataset (see below for example), when using _ax = plt.figure().gca()
_y = (d9["VNA_ch1_magnitude"]
.assign_coords(VNA_ch1_ch1_frequency = lambda x: (x.VNA_ch1_ch1_frequency * 1e-6).assign_attrs(long_name="Probe frequency", units="MHz"),
Valon_CW_frequency = lambda x: (x.Valon_CW_frequency * 1e-9).assign_attrs(long_name="Heater frequency", units="GHz")
))
abs(_y).T.plot(ax=_ax)
abs(_y).idxmin("VNA_ch1_ch1_frequency").plot(ax=_ax, color="red")
_ax.set_ylabel("Probe frequency [MHz]") |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is more likely because you call See also the |
Beta Was this translation helpful? Give feedback.
This is more likely because you call
T
on the first one but not on the second. Can you switch the order of the plot calls?See also the
Note
in this section of the docs: https://docs.xarray.dev/en/stable/user-guide/plotting.html#calling-matplotlib