Plot
Some tools to make plotting with MPL easier.
Import as:
corr_error_bars(ax, xdata, ydata, xerr, yerr, rho, linestyle='-', linewidth=0.5, marker='None', color='tab:blue', label=None, zorder=10, **kwargs)
Plot correlated error bars on a given axes.
Further arguments to specify plot can be passed as **kwargs, which will be passed
to the matplotlib.pyplot.plot routine.
Currently only tested with some Mo data from Stephan et al. (2019) and compared in Inkscape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes
|
Matplotlib axes to plot on |
required |
xdata
|
ndarray
|
data for x values |
required |
ydata
|
ndarray
|
data for y values |
required |
xerr
|
ndarray
|
uncertainty for x values |
required |
yerr
|
ndarray
|
uncertainty for y values |
required |
rho
|
ndarray
|
correlation coefficient |
required |
linestyle
|
str
|
Matplotlib linestyle, defaults to '-' |
'-'
|
linewidth
|
float
|
Width of the error bar line, defaults to 0.5 |
0.5
|
marker
|
str
|
Matplotlib Marker, defaults to 'None'. Note: These would be the end markers of the line, not a marker in the middle! |
'None'
|
color
|
str
|
Matplotlib color, defaults to 'tab:blue' |
'tab:blue'
|
label
|
str
|
Label for data, only used if marker is not None. |
None
|
zorder
|
int
|
Some value to define order. |
10
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in src/rttools/plot.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |