I have been trying to figure out how to insert a label or text in my timeseries plot. I keep getting an error.
Either.
ValueError: expected a value of type Real, got 2013-07-03 00:00:00 of type Timestamp (using Label())
ValueError: expected an element of either String, Dict(String, Either(String, Instance(Transform), Instance(ColorMapper), Float)) or Float, got Timestamp(‘2013-07-03 00:00:00’, offset=‘B’)
I am not sure what I am doing wrong. I would be grateful for any help. I tried using DatetimeIndex and PeriodIndex
An example below of the errors are below using Bokeh 0.12.4 and python 3.5.2:
import numpy as np
import pandas as pd
from bokeh.plotting import figure, output_file, show
from bokeh.models import Label
x = pd.date_range(‘2010-01-01’,‘2017-01-01’, freq= ‘B’)
y = x.to_period(‘B’)
data = np.random.randn(len(x))*100
output_file(‘label_test.html’)
timeseries = pd.Series(data, index = x)
timeseries2 =pd.Series(data, index = y)
plot1 = figure(x_axis_type = ‘datetime’)
plot1.line(x, data)
plot1.text(x = x[len(x)//2], y = np.max(data), text = ‘success’)
In the mean time, a workaround is to explicitly convert the datetime values into floating point "milliseconds since epoch" which is the actual serialization format that is used under the hood.
I have been trying to figure out how to insert a label or text in my timeseries plot. I keep getting an error.
Either.
1. ValueError: expected a value of type Real, got 2013-07-03 00:00:00 of type Timestamp (using Label())
2. ValueError: expected an element of either String, Dict(String, Either(String, Instance(Transform), Instance(ColorMapper), Float)) or Float, got Timestamp('2013-07-03 00:00:00', offset='B')
I am not sure what I am doing wrong. I would be grateful for any help. I tried using DatetimeIndex and PeriodIndex
An example below of the errors are below using Bokeh 0.12.4 and python 3.5.2:
import numpy as np
import pandas as pd
from bokeh.plotting import figure, output_file, show
from bokeh.models import Label
x = pd.date_range('2010-01-01','2017-01-01', freq= 'B')
y = x.to_period('B')
data = np.random.randn(len(x))*100
output_file('label_test.html')
timeseries = pd.Series(data, index = x)
timeseries2 =pd.Series(data, index = y)
As always, thank you very much. I am hoping that datetime will be supported in a future release.
I would appreciate if you can have a look at an issue I posted on Jan. 11 when you have the time. I believe there is an issue with the Legends outside the plot area. When decreasing the size of the plot, the plot container (plot + legend) reduces in size, but the plot does not keep its default proportions and the legend container maintains the same size (so when resizing, the actual plot looks disproportionate and becomes almost invisible) I think if the legend is in a different container (div element) this would not cause problems.
Apologies but I've lost two weeks to being sick, then a conference. Now my laptop has died and I am struggling to get a fully working dev environment set up on a completely new laptop. I am about 400 emails and messages underwater, I need to get a new dev build out, and help provide guidance for the tasks already prioritized for 0.12.5 that are behind. I wish I could promise to look at that soon personally, but realistically, that will probably not be possible.
If it seems like a bug (sounds quite possible from the description) then the best thing to do is to submit a GH bug report issue with code to reproduce, so that it does not get lost in the shuffle, and can be properly prioritized in the context of a larger group of people.
As always, thank you very much. I am hoping that datetime will be supported in a future release.
I would appreciate if you can have a look at an issue I posted on Jan. 11 when you have the time. I believe there is an issue with the Legends outside the plot area. When decreasing the size of the plot, the plot container (plot + legend) reduces in size, but the plot does not keep its default proportions and the legend container maintains the same size (so when resizing, the actual plot looks disproportionate and becomes almost invisible) I think if the legend is in a different container (div element) this would not cause problems.
On Monday, February 13, 2017 at 5:57:19 PM UTC-5, Bryan Van de ven wrote:
Hi,
Apologies but I’ve lost two weeks to being sick, then a conference. Now my laptop has died and I am struggling to get a fully working dev environment set up on a completely new laptop. I am about 400 emails and messages underwater, I need to get a new dev build out, and help provide guidance for the tasks already prioritized for 0.12.5 that are behind. I wish I could promise to look at that soon personally, but realistically, that will probably not be possible.
If it seems like a bug (sounds quite possible from the description) then the best thing to do is to submit a GH bug report issue with code to reproduce, so that it does not get lost in the shuffle, and can be properly prioritized in the context of a larger group of people.
As always, thank you very much. I am hoping that datetime will be supported in a future release.
I would appreciate if you can have a look at an issue I posted on Jan. 11 when you have the time. I believe there is an issue with the Legends outside the plot area. When decreasing the size of the plot, the plot container (plot + legend) reduces in size, but the plot does not keep its default proportions and the legend container maintains the same size (so when resizing, the actual plot looks disproportionate and becomes almost invisible) I think if the legend is in a different container (div element) this would not cause problems.