56
56
# date range.)
57
57
# TODO: When the number of bars to be plotted is less than the number of bars
58
58
# requested (because there isn't enough data), the bars plot funny.
59
- # TODO: add each devices.xml section to its own template file.
60
59
# TODO: do stack plots support markers? Not inherently (apparently) but you
61
60
# can fool it by laying a line on top of the stack. May want to just not
62
61
# support it for now...
110
109
__license__ = Dave .__license__
111
110
__build__ = Dave .__build__
112
111
__title__ = "Matplotlib Plugin for Indigo Home Control"
113
- __version__ = "0.8.20 "
112
+ __version__ = "0.8.21 "
114
113
115
114
# =============================================================================
116
115
@@ -3071,10 +3070,6 @@ def __init__(self, plugin):
3071
3070
self .final_data = []
3072
3071
self .host_plugin = plugin
3073
3072
3074
- # TODO: Markers will need to be added through a secondary plot which uses a
3075
- # line plot (stackplots don't support markers).
3076
- # TODO: Min, Max and annotations plot on their absolute value and not the spot
3077
- # where they are.
3078
3073
# =============================================================================
3079
3074
def chart_area (self , dev , p_dict , k_dict , return_queue ):
3080
3075
"""
@@ -3098,7 +3093,7 @@ def chart_area(self, dev, p_dict, k_dict, return_queue):
3098
3093
p_dict ['faceColor' ] = r"#{0}" .format (p_dict ['faceColor' ].replace (' ' , '' ).replace ('#' , '' ))
3099
3094
x_obs = ''
3100
3095
y_obs_tuple = () # Y values
3101
- y_obs_tuple_rel = {}
3096
+ y_obs_tuple_rel = {} # Y values relative to chart (cumulative value)
3102
3097
y_colors_tuple = () # Y area colors
3103
3098
3104
3099
ax = self .make_chart_figure (p_dict ['chart_width' ], p_dict ['chart_height' ], p_dict )
@@ -3112,7 +3107,7 @@ def chart_area(self, dev, p_dict, k_dict, return_queue):
3112
3107
3113
3108
p_dict ['area{0}Color' .format (area )] = r"#{0}" .format (p_dict ['area{0}Color' .format (area )].replace (' ' , '' ).replace ('#' , '' ))
3114
3109
3115
- # p_dict['area{0}MarkerColor'.format(area)] = r"#{0}".format(p_dict['area{0}MarkerColor'.format(area)].replace(' ', '').replace('#', ''))
3110
+ p_dict ['area{0}MarkerColor' .format (area )] = r"#{0}" .format (p_dict ['area{0}MarkerColor' .format (area )].replace (' ' , '' ).replace ('#' , '' ))
3116
3111
3117
3112
# If area color is the same as the background color, alert the user.
3118
3113
if p_dict ['area{0}Color' .format (area )] == p_dict ['backgroundColor' ]:
@@ -3190,7 +3185,6 @@ def chart_area(self, dev, p_dict, k_dict, return_queue):
3190
3185
3191
3186
# New annotations code ends here - DaveL17 2019-06-05
3192
3187
3193
- log ['Info' ].append (u"{0}" .format (y_obs_tuple_rel ))
3194
3188
if p_dict ['area{0}Annotate' .format (area )]:
3195
3189
for xy in zip (p_dict ['x_obs{0}' .format (area )], y_obs_tuple_rel ['y_obs{0}' .format (area )]):
3196
3190
ax .annotate (u"{0}" .format (xy [1 ]), xy = xy , xytext = (0 , 0 ), zorder = 10 , ** k_dict ['k_annotation' ])
@@ -3278,6 +3272,12 @@ def chart_area(self, dev, p_dict, k_dict, return_queue):
3278
3272
if self .host_plugin .pluginPrefs .get ('forceOriginLines' , True ):
3279
3273
ax .axhline (y = 0 , color = p_dict ['spineColor' ])
3280
3274
3275
+ # ================================== Markers ==================================
3276
+ # Note that stackplots don't support markers, so we need to plot a line (with
3277
+ # no width) on the plot to receive the markers.
3278
+ ax .plot_date (p_dict ['x_obs{0}' .format (area )], y_obs_tuple_rel ['y_obs{0}' .format (area )], marker = p_dict ['area{0}Marker' .format (area )],
3279
+ markeredgecolor = p_dict ['area{0}MarkerColor' .format (area )], markerfacecolor = p_dict ['area{0}MarkerColor' .format (area )], zorder = 10 , lw = 0 )
3280
+
3281
3281
self .format_custom_line_segments (ax , p_dict , k_dict , log )
3282
3282
self .format_grids (p_dict , k_dict , log )
3283
3283
self .format_title (p_dict , k_dict , log , loc = (0.5 , 0.98 ))
0 commit comments