Page 1 of 1

matplotlib - error setting axis limits for y1

PostPosted: Sat May 04, 2019 9:43 am
by bsp9493
Matplotlib Debug [mdailyWeather] prefs cleaned.
Matplotlib [10dayForecast] chart updated successfully.
Matplotlib Warning [mdailyWeather] Error setting axis limits for Y1. Will rely on Matplotlib to determine limits.
Matplotlib Warning [mdailyWeather] chart updated with errors. See plugin log for more information.
Matplotlib Warning [pool temp trends] Error setting axis limits for Y1. Will rely on Matplotlib to determine limits.
Matplotlib Warning [pool temp trends] chart updated with errors. See plugin log for more information.
Matplotlib [weatherAlert] chart updated successfully.
Matplotlib ==================== Redraw Charts Now Menu Action Complete ====


was playing with some settings, noticed I can mirror y values on right axis

checked the setting, also checked keep the other y.

didn't like it, so I unchecked both mirroring related boxes, now I get the above error when I try to redraw the charts.

Your help would be appreciated.

Thanx

dave

Re: matplotlib - error setting axis limits for y1

PostPosted: Sat May 04, 2019 4:04 pm
by DaveL17
Hi Dave -- sorry you're having trouble. Take a look at the Y axis limits settings for the chart device. The plugin is saying that there's something amiss with those settings.

Screen Shot 2019-05-04 at 5.00.36 PM.png
Screen Shot 2019-05-04 at 5.00.36 PM.png (40.58 KiB) Viewed 2435 times

Re: matplotlib - error setting axis limits for y1

PostPosted: Sat May 04, 2019 9:57 pm
by bsp9493
Did that... they are both set to NONE...

Interesting, if i set limits with actual numbers, error goes away.

Further investigation ... appears a data point i removed, ie not available in the csv, still shows in the device /chart as a selection

Re: matplotlib - error setting axis limits for y1

PostPosted: Sun May 05, 2019 4:32 am
by DaveL17
bsp9493 wrote:
Further investigation ... appears a data point i removed, ie not available in the csv, still shows in the device /chart as a selection

I just want to be sure I understand. You removed a CSV source file, but that source still shows up under the device as a data source for one of the lines?

If that's the case, you should get a warning like this:
Code: Select all
   Matplotlib Warning              [Matplotlib - chart name] Error downloading CSV data: [Errno 2] No such file or directory: '/Users/dave/Documents/archive/dave from bc.csv'. See plugin log for more information.

Re: matplotlib - error setting axis limits for y1

PostPosted: Sun May 05, 2019 7:53 am
by bsp9493
image from line chart and csv engine

Re: matplotlib - error setting axis limits for y1

PostPosted: Sun May 05, 2019 2:05 pm
by DaveL17
You can have as many CSV files in the folder as you like, and they don't have to be managed by a CSV Engine device. Whatever is in the folder will show up as a valid source.

If you have eliminated data and no longer need it, then I'd suggest deleting the files from the data folder or moving them to another location.

Re: matplotlib - error setting axis limits for y1

PostPosted: Mon May 06, 2019 12:54 pm
by bsp9493
Thank you for that...

I managed to clean out the old/changed csv files,


plug in log looks like this after a refresh, noting y1 axis limits still. As far as I can tell, all the data is positive

[10dayForecast] chart updated successfully.
2019-05-06 11:50:44.615 CRITICAL Plugin.pluginErrorHandler !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TRACEBACK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2019-05-06 11:50:44.617 CRITICAL Plugin.pluginErrorHandler !!! Traceback (most recent call last):
2019-05-06 11:50:44.617 CRITICAL Plugin.pluginErrorHandler !!! File "plugin.py", line 4458, in format_axis_y1_min_max
2019-05-06 11:50:44.617 CRITICAL Plugin.pluginErrorHandler !!! y_axis_min = y_min * (1 - (1 / y_min ** 1.25))
2019-05-06 11:50:44.618 CRITICAL Plugin.pluginErrorHandler !!! ValueError: negative number cannot be raised to a fractional power
2019-05-06 11:50:44.618 CRITICAL Plugin.pluginErrorHandler !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2019-05-06 11:50:46.049 INFO Plugin.csv_refresh_process [matPlotLibCSV] CSV data updated successfully.
2019-05-06 11:50:46.390 WARNING Plugin.processLogQueue [mdailyWeather] Error setting axis limits for Y1. Will rely on Matplotlib to determine limits.
2019-05-06 11:50:46.390 WARNING Plugin.processLogQueue [mdailyWeather] chart updated with errors. See plugin log for more information.
2019-05-06 11:50:46.904 CRITICAL Plugin.pluginErrorHandler !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TRACEBACK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2019-05-06 11:50:46.905 CRITICAL Plugin.pluginErrorHandler !!! Traceback (most recent call last):
2019-05-06 11:50:46.905 CRITICAL Plugin.pluginErrorHandler !!! File "plugin.py", line 4458, in format_axis_y1_min_max
2019-05-06 11:50:46.905 CRITICAL Plugin.pluginErrorHandler !!! y_axis_min = y_min * (1 - (1 / y_min ** 1.25))
2019-05-06 11:50:46.906 CRITICAL Plugin.pluginErrorHandler !!! ValueError: negative number cannot be raised to a fractional power
2019-05-06 11:50:46.907 CRITICAL Plugin.pluginErrorHandler !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2019-05-06 11:50:47.866 WARNING Plugin.processLogQueue [pool temp trends] Error setting axis limits for Y1. Will rely on Matplotlib to determine limits.
2019-05-06 11:50:47.867 WARNING Plugin.processLogQueue [pool temp trends] chart updated with errors. See plugin log for more information.
2019-05-06 11:50:48.607 INFO Plugin.processLogQueue [weatherAlert] chart updated successfully.
2019-05-06 11:50:48.610 INFO Plugin.refresh_the_charts_now ==================== Redraw Charts Now Menu Action Complete ====================
2019-05-06 11:51:17.061 INFO Plugin.csv_refresh_process [matPlotLibCSV] CSV data updated successfully.

Re: matplotlib - error setting axis limits for y1

PostPosted: Mon May 06, 2019 3:47 pm
by DaveL17
That looks like a bug. What do you have as the setting for y1 axis minimum in the device configuration dialog for the mdailyWeather device and the pool temp trends device?

Re: matplotlib - error setting axis limits for y1

PostPosted: Mon May 06, 2019 4:07 pm
by DaveL17
If you're so inclined, I think this change should keep the error from happening.
Code: Select all
y_axis_min = y_min * (1 - (1 / abs(y_min) ** 1.25))

In this context, y_min is the minimum of the data array for the plotted element so I think it's likely that there's a negative value in there somewhere. Regardless, by using the absolute value of the number in question, the result is the same from a charting perspective, so this small change should fix things.