spedas / pyspedas

Python-based Space Physics Environment Data Analysis Software
https://pyspedas.readthedocs.io/
MIT License
143 stars 58 forks source link

Missing traces, incorrect legends when plotting pseudovariables #796

Closed jameswilburlewis closed 3 months ago

jameswilburlewis commented 4 months ago

The following code combines two variables with different numbers of traces. The results depend on the order in which they're combined; in both cases the legends are incorrect. If the single trace comes before the 3-trace variable, the traces are correct, but if they're combined in the opposite order, only 1 trace is shown.

import pyspedas
from pytplot import store_data,tplot

pyspedas.themis.fgm(probe='c')
store_data('comb_3_1',data=['thc_fge_dsl','thc_fge_btotal'])
store_data('comb_1_3',data=['thc_fge_btotal','thc_fge_dsl'])
tplot('comb_1_3') # plots all 4 traces but legend is wrong (Bmag twice and nothing else)
tplot('comb_3_1') # only plots 1 trace JWL 2024-02-19
jameswilburlewis commented 3 months ago

Fixed now!