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

spedas / pyspedas / 17001196665

15 Aug 2025 11:12PM UTC coverage: 89.516% (+0.7%) from 88.849%
17001196665

push

github

web-flow
Merge branch 'pyspedas_2_0_dev' into master

5072 of 6199 new or added lines in 413 files covered. (81.82%)

8 existing lines in 2 files now uncovered.

40061 of 44753 relevant lines covered (89.52%)

0.9 hits per line

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

75.68
/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✔
NEW
15
        new_tplot_opt_glob['var_label'] = value
×
16

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

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

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

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

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

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

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

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

41
    elif option == 'ysize':
1✔
NEW
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))
1✔
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
        ==================  ==========   =====
82

83
    Returns
84
    -------
85
        None
86
    
87
    Examples
88
    --------
89
        >>> # Set the plot title
90
        >>> import pyspedas
91
        >>> pyspedas.tplot_options('title', 'SWEA Data for Orbit 1563')
92
    
93
    """
94
    
95
    option = option.lower()
1✔
96
    
97
    temp = set_tplot_options(option, value, pyspedas.tplot_tools.tplot_opt_glob)
1✔
98
    pyspedas.tplot_tools.tplot_opt_glob = temp
1✔
99
    
100
    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