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

spedas / pyspedas / 25223758709

01 May 2026 04:46PM UTC coverage: 56.446% (-34.1%) from 90.54%
25223758709

push

github

jameswilburlewis
Temporarily disabling Cluster tests due to problems at CSA

27633 of 48955 relevant lines covered (56.45%)

0.56 hits per line

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

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

4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

50
    return new_tplot_opt_glob
1✔
51

52

53
def tplot_options(option, value):
1✔
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()
1✔
98
    
99
    temp = set_tplot_options(option, value, pyspedas.tplot_tools.tplot_opt_glob)
1✔
100
    pyspedas.tplot_tools.tplot_opt_glob = temp
1✔
101
    
102
    return
1✔
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