Add a 1:1 to a bokeh plot

I have a dataframe df:

df<-structure(list(y = c(0.184835087795765, 0.0477979578187421, 0.330254224288687,

0.154269972451791, 0.177288332003698, -0.828500102904594, 0.0097065144096378, 0.174631281749129, 0.059485053311508, -0.15517826103028, 0.0387069978073843, -0.328598175602143, -0.370025191240733, -0.137520145873606, -0.517345044182086, -0.95855276638734, 0.142157818807061, 0.0555602849847647, 0.0790883079271277, -0.469712960073942, 0.0476276990740917, 0.0180866682032147, -0.844462681202202, 0.168690281267659, 0.0982353549785612, 0.104308575981326, -0.034253543227478, 0.32228412929307, -0.00333698344429625, 0.318488090677966, 0.0520107052513902, 0.0406141222384914, 0.278140968086261, 0.199340497277876, -0.0885984356184118, 0.361158895750753, 0.157367169947273, 0.167729635404344, 0.0402095028508296, 0.306378110222216, 0.415816595851383, 0.345404898473868, 0.673442930902624, 0.357186931301173, 0.30316918028299, 0.241977200837253, 0.286377823067039, -1.04211529518783, 0.214380899413939, 0.103576799855296, 0.341776296210327, -0.127402274709119, 0.36026936026936, 0.0840512564206743, -0.404258834357294, 0.303233695468846, 0.281818943258327, 0.32915413791837, 0.174632793111875, 0.295466519536965, 0.163739883365941, 0.0534353554933628, 0.2600287854009, 0.220404652949875, 0.131889895765782, 0.107895905158241, 0.10314248961821, 0.117006167902025, 0.00699300699300699, 0.162361623616236, 0.140845070422535, 0.218560252895857, -0.0382606628945043, 0.296377607025247, 0.339752407152682, 0.128700128700129, -0.00415357631594164), x = c(0.2478505402725, 0.0779763869295653, 0.192213161135949, 0.336356923181335, 0.252384326474696, -0.585794455730121, 0.210928847831094, 0.161515551310582, -0.0397509536441528, -0.198977235202143, -0.154215746035278, -0.150896850171597, -0.175288312544715, -0.167561959590438, -0.0647775810147959, -0.344867715329938, 0.022449461601258, 0.0361387049398407, 0.00311052189352302, -0.737436761648367, 0.141783853683833, -0.0356065032618254, -0.739889339775345, -0.00141767565522554, 0.129415675178355, 0.134819474098321, 0.0992512426228519, 0.200162551536665, 0.0738215682764728, 0.289032945956798, 0.119908971799754, 0.137902550631945, 0.320713495672507, 0.135970745980787, 0.0786165505402132, 0.406017012046664, 0.170885108998374, 0.240018802438078, -0.0810146763627372, 0.279330189788912, 0.444607532315293, 0.229552297431814, 0.266549995721244, 0.577831122312127, 0.478551763614123, 0.175056689362304, 0.153232330682899, -1.06547276110643, 0.0949587749742577, 0.206831583907499, 0.257123133974772, 0.0290376032141627, 0.555131597009896, 0.0951615162367911, -0.647477465462792, 0.22105256270821, 0.197086801313393, 0.194064363262737, 0.273127590159304, 0.11118517945335, 0.133286966106915, 0.146906033942448, 0.0538098771807183, 0.327883303202309, 0.134602569483204, 0.223022118754573, 0.253307698639286, 0.176520998331059, 0.030824097055851, 0.0542468191651385, -0.0968076021342648, 0.222668910796631, 0.00362408805063608, 0.135229319796382, -0.109151687102796, 0.102962540293443, 0.0224839880142136)), .Names = c("y", "x"), row.names = c(NA, -77L), class = "data.frame")

I am ploting this data as such:

require(rbokeh)

figure(xlab = “Prediction”,

ylab = “Observation”) %>%

ly_points(x, y, data =df)%>%

ly_abline(1, 1)

I wanted to include a one to one line to this figure but it does not work with the function ly_abline. Anyone knows how I can fix it?

Cheers,

Simon.

···

Simon Besnard****Ph.D. Candidate at Max Planck Institute and Wageningen University

**Phone: **(+31) 06 28 68 87 74 | **Skype: **besnard.simon

Email: [email protected]

I'm replying to this just to add [rbokeh] to the title.

Bokeh has a Span annotation:

  annotations — Bokeh 3.3.2 Documentation

That can be used to draw horizontal or vertical lines at fixed screen or data positions, but I do not know if this has been exposed to RBokeh yet. Hopefully with the [rbokeh] in the title, someone who knows more can chime in.

Thanks,

Bryan

···

On Feb 23, 2016, at 3:57 AM, Simon Besnard <[email protected]> wrote:

I have a dataframe df:
df<-structure(list(y = c(0.184835087795765, 0.0477979578187421, 0.330254224288687,
0.154269972451791, 0.177288332003698, -0.828500102904594, 0.0097065144096378,
0.174631281749129, 0.059485053311508, -0.15517826103028, 0.0387069978073843,
-0.328598175602143, -0.370025191240733, -0.137520145873606, -0.517345044182086,
-0.95855276638734, 0.142157818807061, 0.0555602849847647, 0.0790883079271277,
-0.469712960073942, 0.0476276990740917, 0.0180866682032147, -0.844462681202202,
0.168690281267659, 0.0982353549785612, 0.104308575981326, -0.034253543227478,
0.32228412929307, -0.00333698344429625, 0.318488090677966, 0.0520107052513902,
0.0406141222384914, 0.278140968086261, 0.199340497277876, -0.0885984356184118,
0.361158895750753, 0.157367169947273, 0.167729635404344, 0.0402095028508296,
0.306378110222216, 0.415816595851383, 0.345404898473868, 0.673442930902624,
0.357186931301173, 0.30316918028299, 0.241977200837253, 0.286377823067039,
-1.04211529518783, 0.214380899413939, 0.103576799855296, 0.341776296210327,
-0.127402274709119, 0.36026936026936, 0.0840512564206743, -0.404258834357294,
0.303233695468846, 0.281818943258327, 0.32915413791837, 0.174632793111875,
0.295466519536965, 0.163739883365941, 0.0534353554933628, 0.2600287854009,
0.220404652949875, 0.131889895765782, 0.107895905158241, 0.10314248961821,
0.117006167902025, 0.00699300699300699, 0.162361623616236, 0.140845070422535,
0.218560252895857, -0.0382606628945043, 0.296377607025247, 0.339752407152682,
0.128700128700129, -0.00415357631594164), x = c(0.2478505402725,
0.0779763869295653, 0.192213161135949, 0.336356923181335, 0.252384326474696,
-0.585794455730121, 0.210928847831094, 0.161515551310582, -0.0397509536441528,
-0.198977235202143, -0.154215746035278, -0.150896850171597, -0.175288312544715,
-0.167561959590438, -0.0647775810147959, -0.344867715329938,
0.022449461601258, 0.0361387049398407, 0.00311052189352302, -0.737436761648367,
0.141783853683833, -0.0356065032618254, -0.739889339775345, -0.00141767565522554,
0.129415675178355, 0.134819474098321, 0.0992512426228519, 0.200162551536665,
0.0738215682764728, 0.289032945956798, 0.119908971799754, 0.137902550631945,
0.320713495672507, 0.135970745980787, 0.0786165505402132, 0.406017012046664,
0.170885108998374, 0.240018802438078, -0.0810146763627372, 0.279330189788912,
0.444607532315293, 0.229552297431814, 0.266549995721244, 0.577831122312127,
0.478551763614123, 0.175056689362304, 0.153232330682899, -1.06547276110643,
0.0949587749742577, 0.206831583907499, 0.257123133974772, 0.0290376032141627,
0.555131597009896, 0.0951615162367911, -0.647477465462792, 0.22105256270821,
0.197086801313393, 0.194064363262737, 0.273127590159304, 0.11118517945335,
0.133286966106915, 0.146906033942448, 0.0538098771807183, 0.327883303202309,
0.134602569483204, 0.223022118754573, 0.253307698639286, 0.176520998331059,
0.030824097055851, 0.0542468191651385, -0.0968076021342648, 0.222668910796631,
0.00362408805063608, 0.135229319796382, -0.109151687102796, 0.102962540293443,
0.0224839880142136)), .Names = c("y", "x"), row.names = c(NA,
-77L), class = "data.frame")

I am ploting this data as such:

require(rbokeh)
figure(xlab = "Prediction",
                    ylab = "Observation") %>%
  ly_points(x, y, data =df)%>%
  ly_abline(1, 1)

I wanted to include a one to one line to this figure but it does not work with the function ly_abline. Anyone knows how I can fix it?

Cheers,

Simon.

--
Simon Besnard
Ph.D. Candidate at Max Planck Institute and Wageningen University
Phone: (+31) 06 28 68 87 74 | Skype: besnard.simon
Email: [email protected]

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAD8x4CLApEc3qBk-qUnEa6fU1amA18QKoeZ5K4nK6vkgMOYD9g%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Is what follows what you want? The ly_abline arguments of a and b follow the R abline arguments and the standard is a=0, b=1 for a a slope 1 line through intercept (0,0)

require(rbokeh)

df<-structure(list(y = c(0.184835087795765, 0.0477979578187421, 0.330254224288687,

0.154269972451791, 0.177288332003698, -0.828500102904594, 0.0097065144096378,

0.174631281749129, 0.059485053311508, -0.15517826103028, 0.0387069978073843,

-0.328598175602143, -0.370025191240733, -0.137520145873606, -0.517345044182086,

-0.95855276638734, 0.142157818807061, 0.0555602849847647, 0.0790883079271277,

-0.469712960073942, 0.0476276990740917, 0.0180866682032147, -0.844462681202202,

0.168690281267659, 0.0982353549785612, 0.104308575981326, -0.034253543227478,

0.32228412929307, -0.00333698344429625, 0.318488090677966, 0.0520107052513902,

0.0406141222384914, 0.278140968086261, 0.199340497277876, -0.0885984356184118,

0.361158895750753, 0.157367169947273, 0.167729635404344, 0.0402095028508296,

0.306378110222216, 0.415816595851383, 0.345404898473868, 0.673442930902624,

0.357186931301173, 0.30316918028299, 0.241977200837253, 0.286377823067039,

-1.04211529518783, 0.214380899413939, 0.103576799855296, 0.341776296210327,

-0.127402274709119, 0.36026936026936, 0.0840512564206743, -0.404258834357294,

0.303233695468846, 0.281818943258327, 0.32915413791837, 0.174632793111875,

0.295466519536965, 0.163739883365941, 0.0534353554933628, 0.2600287854009,

0.220404652949875, 0.131889895765782, 0.107895905158241, 0.10314248961821,

0.117006167902025, 0.00699300699300699, 0.162361623616236, 0.140845070422535,

0.218560252895857, -0.0382606628945043, 0.296377607025247, 0.339752407152682,

0.128700128700129, -0.00415357631594164), x = c(0.2478505402725,

0.0779763869295653, 0.192213161135949, 0.336356923181335, 0.252384326474696,

-0.585794455730121, 0.210928847831094, 0.161515551310582, -0.0397509536441528,

-0.198977235202143, -0.154215746035278, -0.150896850171597, -0.175288312544715,

-0.167561959590438, -0.0647775810147959, -0.344867715329938,

0.022449461601258, 0.0361387049398407, 0.00311052189352302, -0.737436761648367,

0.141783853683833, -0.0356065032618254, -0.739889339775345, -0.00141767565522554,

0.129415675178355, 0.134819474098321, 0.0992512426228519, 0.200162551536665,

0.0738215682764728, 0.289032945956798, 0.119908971799754, 0.137902550631945,

0.320713495672507, 0.135970745980787, 0.0786165505402132, 0.406017012046664,

0.170885108998374, 0.240018802438078, -0.0810146763627372, 0.279330189788912,

0.444607532315293, 0.229552297431814, 0.266549995721244, 0.577831122312127,

0.478551763614123, 0.175056689362304, 0.153232330682899, -1.06547276110643,

0.0949587749742577, 0.206831583907499, 0.257123133974772, 0.0290376032141627,

0.555131597009896, 0.0951615162367911, -0.647477465462792, 0.22105256270821,

0.197086801313393, 0.194064363262737, 0.273127590159304, 0.11118517945335,

0.133286966106915, 0.146906033942448, 0.0538098771807183, 0.327883303202309,

0.134602569483204, 0.223022118754573, 0.253307698639286, 0.176520998331059,

0.030824097055851, 0.0542468191651385, -0.0968076021342648, 0.222668910796631,

0.00362408805063608, 0.135229319796382, -0.109151687102796, 0.102962540293443,

0.0224839880142136)), .Names = c(“y”, “x”), row.names = c(NA,

-77L), class = “data.frame”)

f = figure(xlab = “Prediction”,

ylab = “Observation”) %>%

ly_points(x, y, data =df) %>% ly_abline(a=0, b=1)

···

On Thursday, March 3, 2016 at 5:46:13 PM UTC-8, Bryan Van de ven wrote:

I’m replying to this just to add [rbokeh] to the title.

Bokeh has a Span annotation:

    [http://bokeh.pydata.org/en/latest/docs/reference/models/annotations.html#bokeh.models.annotations.Span](http://bokeh.pydata.org/en/latest/docs/reference/models/annotations.html#bokeh.models.annotations.Span)

That can be used to draw horizontal or vertical lines at fixed screen or data positions, but I do not know if this has been exposed to RBokeh yet. Hopefully with the [rbokeh] in the title, someone who knows more can chime in.

Thanks,

Bryan

On Feb 23, 2016, at 3:57 AM, Simon Besnard [email protected] wrote:

I have a dataframe df:
df<-structure(list(y = c(0.184835087795765, 0.0477979578187421, 0.330254224288687,
0.154269972451791, 0.177288332003698, -0.828500102904594, 0.0097065144096378,
0.174631281749129, 0.059485053311508, -0.15517826103028, 0.0387069978073843,
-0.328598175602143, -0.370025191240733, -0.137520145873606, -0.517345044182086,
-0.95855276638734, 0.142157818807061, 0.0555602849847647, 0.0790883079271277,
-0.469712960073942, 0.0476276990740917, 0.0180866682032147, -0.844462681202202,
0.168690281267659, 0.0982353549785612, 0.104308575981326, -0.034253543227478,
0.32228412929307, -0.00333698344429625, 0.318488090677966, 0.0520107052513902,
0.0406141222384914, 0.278140968086261, 0.199340497277876, -0.0885984356184118,
0.361158895750753, 0.157367169947273, 0.167729635404344, 0.0402095028508296,
0.306378110222216, 0.415816595851383, 0.345404898473868, 0.673442930902624,
0.357186931301173, 0.30316918028299, 0.241977200837253, 0.286377823067039,
-1.04211529518783, 0.214380899413939, 0.103576799855296, 0.341776296210327,
-0.127402274709119, 0.36026936026936, 0.0840512564206743, -0.404258834357294,
0.303233695468846, 0.281818943258327, 0.32915413791837, 0.174632793111875,
0.295466519536965, 0.163739883365941, 0.0534353554933628, 0.2600287854009,
0.220404652949875, 0.131889895765782, 0.107895905158241, 0.10314248961821,
0.117006167902025, 0.00699300699300699, 0.162361623616236, 0.140845070422535,
0.218560252895857, -0.0382606628945043, 0.296377607025247, 0.339752407152682,
0.128700128700129, -0.00415357631594164), x = c(0.2478505402725,
0.0779763869295653, 0.192213161135949, 0.336356923181335, 0.252384326474696,
-0.585794455730121, 0.210928847831094, 0.161515551310582, -0.0397509536441528,
-0.198977235202143, -0.154215746035278, -0.150896850171597, -0.175288312544715,
-0.167561959590438, -0.0647775810147959, -0.344867715329938,
0.022449461601258, 0.0361387049398407, 0.00311052189352302, -0.737436761648367,
0.141783853683833, -0.0356065032618254, -0.739889339775345, -0.00141767565522554,
0.129415675178355, 0.134819474098321, 0.0992512426228519, 0.200162551536665,
0.0738215682764728, 0.289032945956798, 0.119908971799754, 0.137902550631945,
0.320713495672507, 0.135970745980787, 0.0786165505402132, 0.406017012046664,
0.170885108998374, 0.240018802438078, -0.0810146763627372, 0.279330189788912,
0.444607532315293, 0.229552297431814, 0.266549995721244, 0.577831122312127,
0.478551763614123, 0.175056689362304, 0.153232330682899, -1.06547276110643,
0.0949587749742577, 0.206831583907499, 0.257123133974772, 0.0290376032141627,
0.555131597009896, 0.0951615162367911, -0.647477465462792, 0.22105256270821,
0.197086801313393, 0.194064363262737, 0.273127590159304, 0.11118517945335,
0.133286966106915, 0.146906033942448, 0.0538098771807183, 0.327883303202309,
0.134602569483204, 0.223022118754573, 0.253307698639286, 0.176520998331059,
0.030824097055851, 0.0542468191651385, -0.0968076021342648, 0.222668910796631,
0.00362408805063608, 0.135229319796382, -0.109151687102796, 0.102962540293443,
0.0224839880142136)), .Names = c(“y”, “x”), row.names = c(NA,
-77L), class = “data.frame”)

I am ploting this data as such:

require(rbokeh)

figure(xlab = “Prediction”,

                ylab = "Observation") %>%

ly_points(x, y, data =df)%>%

ly_abline(1, 1)

I wanted to include a one to one line to this figure but it does not work with the function ly_abline. Anyone knows how I can fix it?

Cheers,

Simon.


Simon Besnard

Ph.D. Candidate at Max Planck Institute and Wageningen University

Phone: (+31) 06 28 68 87 74 | Skype: besnard.simon

Email: [email protected]


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAD8x4CLApEc3qBk-qUnEa6fU1amA18QKoeZ5K4nK6vkgMOYD9g%40mail.gmail.com.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.