• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

spedas / pyspedas / 23369877357

21 Mar 2026 02:13AM UTC coverage: 90.512% (+0.02%) from 90.497%
23369877357

push

github

web-flow
Merge pull request #1342 from spedas/t_1341

Adds support to load USGS Variometer data, adds test cases for loading variometer data.

13 of 48 new or added lines in 3 files covered. (27.08%)

10491 existing lines in 260 files now uncovered.

44303 of 48947 relevant lines covered (90.51%)

1.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.78
/pyspedas/tplot_tools/tplot_options.py
1
import logging
2✔
2
import pyspedas
2✔
3

4

5
def set_tplot_options(option, value, old_tplot_opt_glob):
2✔
6
    new_tplot_opt_glob = old_tplot_opt_glob
2✔
7

8
    if option in ['title_text', 'title']:
2✔
9
        new_tplot_opt_glob['title_text'] = value
2✔
10

11
    elif option == 'title_size':
2✔
UNCOV
12
        new_tplot_opt_glob['title_size'] = value
1✔
13

14
    elif option == 'var_label':
2✔
UNCOV
15
        new_tplot_opt_glob['var_label'] = value
1✔
16

17
    elif option == 'x_range':
2✔
18
        new_tplot_opt_glob['x_range'] = value
×
19

20
    elif option == 'data_gap':
2✔
21
        new_tplot_opt_glob['data_gap'] = value
×
22

23
    elif option == 'axis_font_size':
2✔
UNCOV
24
        new_tplot_opt_glob['axis_font_size'] = value
1✔
25

26
    elif option == 'xmargin':
2✔
UNCOV
27
        new_tplot_opt_glob['xmargin'] = value
1✔
28

29
    elif option == 'ymargin':
2✔
30
        new_tplot_opt_glob['ymargin'] = value
×
31

32
    elif option == 'style':
2✔
33
        new_tplot_opt_glob['style'] = value
×
34

35
    elif option == 'charsize':
2✔
UNCOV
36
        new_tplot_opt_glob['charsize'] = value
1✔
37

38
    elif option == 'xsize':
2✔
39
        new_tplot_opt_glob['xsize'] = value
×
40

41
    elif option == 'ysize':
2✔
42
        new_tplot_opt_glob['ysize'] = value
×
43

44
    elif option == 'varlabel_style':
2✔
UNCOV
45
        new_tplot_opt_glob['varlabel_style'] = value
1✔
46

47
    else:
48
        logging.warning("Unknown option supplied: " + str(option))
2✔
49

50
    return new_tplot_opt_glob
2✔
51

52

53
def tplot_options(option, value):
2✔
54
    """
55
    This function allows the user to set GLOBAL options for the generated plots.
56
    
57
    Parameters
58
    ----------
59
        option : str
60
            The name of the option.  See section below  
61
        value : str/int/float/list
62
            The value of the option.  See section below.  
63
            
64
    Options
65
    -------
66
        ==================  ==========   =====
67
        Option (Synonyms)   Value type   Notes
68
        ==================  ==========   =====
69
        title_text (title)  str          Title of the entire plot (mpl 'suptitle', above any panel titles)
70
        title_size          int          Font size of the title
71
        data_gap            int          Number of seconds with consecutive nan values allowed before no interp should occur
72
        x_range             [flt, flt]   The min and max x_range (time) to be plotted on all plots
73
        axis_font_size      int          The font size of the axis ticks.  Default is 10.
74
        charsize            int          The font size for the legend strings
75
        style               str          The matplotlib plot style to use
76
        xsize               flt          The size of the plot window in the X dimension (units of inches)
77
        ysize               flt          The size of the plot window in the Y dimension (units of inches)
78
        xmargin             [flt, flt]   The width of the left and right margins of the plot (in inches)
79
        ymargin             [flt, flt]   The height of the top and bottom margins of the plot (in inches)
80
        annotations         dict         A dictionary of text, positions, xycoords, and other options to be placed on the plot
81
        varlabel_style      str          Set to 'extra_axes' for each variable on its own axis, or 'extra_panel' for a more compact display in a single panel
82
        ==================  ==========   =====
83

84
    Returns
85
    -------
86
        None
87
    
88
    Examples
89
    --------
90
        >>> # Set the plot title
91
        >>> import pyspedas
92
        >>> pyspedas.tplot_options('title', 'SWEA Data for Orbit 1563')
93
    
94
    """
95

96

97
    option = option.lower()
2✔
98
    
99
    temp = set_tplot_options(option, value, pyspedas.tplot_tools.tplot_opt_glob)
2✔
100
    pyspedas.tplot_tools.tplot_opt_glob = temp
2✔
101
    
102
    return
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc