Skip to content

Commit

Permalink
Add plot tests for adding timebars and databars with line color and l…
Browse files Browse the repository at this point in the history
…ine style options.
  • Loading branch information
jameswilburlewis committed Oct 25, 2024
1 parent 6900eb1 commit b7b9265
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pyspedas/utilities/tests/plot_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytplot

# Set this to false for Github CI tests, set to True for interactive use to see plots.
global_display = False
global_display = True
default_trange=['2007-03-23','2007-03-24']
class PlotTestCases(unittest.TestCase):
"""Test plot functions."""
Expand Down Expand Up @@ -54,6 +54,19 @@ def test_markers_and_symbols_error_bars(self):
options('data', 'marker', 'H')
tplot('data', display=global_display, save_png='hexagons_lineplot_errbars.png')

def test_timebars(self):
from pytplot import timebar
del_data('*')
themis.fgm(probe='c', trange=default_trange)
timebar(t=10000.0,varname='thc_fge_dsl',databar=True,color='black')
timebar(t=-10000.0,varname='thc_fge_dsl',databar=True,color='red', dash=True)
timebar(t=pytplot.time_double('2007-03-23/14:00'),varname='thc_fge_btotal',color='magenta')
timebar(t=pytplot.time_double('2007-03-23/14:30'),color='blue')
timebar(t=pytplot.time_double('2007-03-23/15:30'),color='green', dash=True)
tplot_options('title', 'Databars at +/- 10000 top panel, timebars at 14:30 and 15:30 all panels, timebar at 14:00 bottom panel, linestyles and colors as specified')
tplot(['thc_fge_dsl','thc_fge_btotal'], display=global_display, save_png='timebars.png')
tplot_options('title', '')
timespan('2007-03-23',1,'days') # reset to avoid interfering with other tests


def test_line_pseudovariables(self):
Expand Down

0 comments on commit b7b9265

Please sign in to comment.