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

spedas / pyspedas / 25194239086

26 Apr 2026 08:07PM UTC coverage: 61.697% (-28.8%) from 90.54%
25194239086

push

github

jameswilburlewis
Added test for loading Cluster CODIF differential energy flux

0 of 7 new or added lines in 1 file covered. (0.0%)

19460 existing lines in 418 files now uncovered.

30204 of 48955 relevant lines covered (61.7%)

1.44 hits per line

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

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

4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

UNCOV
50
    return new_tplot_opt_glob
2✔
51

52

53
def tplot_options(option, value):
3✔
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

UNCOV
97
    option = option.lower()
2✔
98
    
UNCOV
99
    temp = set_tplot_options(option, value, pyspedas.tplot_tools.tplot_opt_glob)
2✔
UNCOV
100
    pyspedas.tplot_tools.tplot_opt_glob = temp
2✔
101
    
UNCOV
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