Python - Bokeh Interactive Legend - Attribute Error - bokeh

I am trying to make an interactive legend.
Even when I run the code in this link https://docs.bokeh.org/en/latest/docs/user_guide/interaction/legends.html
I get the error:
AttributeError: unexpected attribute 'legend_label' to Line, possible attributes are js_event_callbacks, js_property_callbacks, line_alpha, line_cap, line_color, line_dash, line_dash_offset, line_join, line_width, name, subscribed_events, tags, x or y
Any ideas why? I have the latest version of Bokeh, as far I know.

Use legend instead of legend_field or legend_label.

legend_label was added in version 1.4. You will have to update to that or later, or else refer to the docs specific to your version:
https://docs.bokeh.org/en/1.3.4/docs/user_guide/interaction/legends.html

I got a similar error when installing bokeh through the shell first and through the conda later. This got me with two versions and the old one was preferred.
I think what solved it for me: uninstalling previous versions, installing only conda (I have done it in Jupyter Notebook) and restarting the computer afterwards. Hope it helps.

Related

How to manage Unfold precompiling error: _iszero not defined?

On a new computer I was trying to run Unfold and UnfoldMakie. See this error in both cases.
Like something wrong with the MutableArithmetics library.
Any idea how to manage it?
Also get this after update of MakieCore package:
Versions:
Julia 1.8.0.
Unfold v0.3.11
UnfoldMakie v0.1.4
It seems as a solution:
These packages work in the julia envv1.7, but do not work in v1.8.
In VScode you can change it here:
Finally figured out the problem:
First, I created a new environment/project.
https://pkgdocs.julialang.org/v1/environments/
Second, activated it in the notebook.
Third, installed problematic libraries through this code:
import Pkg
p = "Unfold"
Pkg.add(p)
Pkg.build(p)

Can't plot step response in Octave

Iam trying to plot step response in Octave (v 4.0.3) using this code:
pkg load control
clf;
s = tf('s');
g = 1/(2*s^2+3*s+4);
step(g);
But I get always the same error:
error: matrix cannot be indexed with .
error: called from
plot at line 198 column 7
__time_response__ at line 207 column 13
step at line 74 column 10
If I used the same code in another computer with Octave 5.0.2 the code works perfectly, so I guess this is some kind of problem with this version.
I just want to know if there is some kind of workaround to plot my step response, cause this I need this particular version of Octave, so upgrade it is not a solution for my right now.
Thanks!
plot has likely changed quite a bit since that old version of Octave came out, and you didn't mention the package version, but I'm guessing you are probably trying to use a current version of control? The newest version would have been coded to accommodate any changes in Octave since then. Best bet might be to try to uninstall the control package (pkg uninstall control) and find an old version from around the same time as Octave 4.0.3.
According to the Octave Major Release History page, 4.0.3 came out on 2016-07-01. Looking at the Control Package News page, you probably want to try control-3.0.0, Release Date: 2015-10-30. (the next version was in 2018 right around Octave 4.2.2, and might also work. I didn't see a note about the plot or step function behavior changing, so you might have to try a couple versions to find one that works with plot from 4.0.3.)
The Octave Control Package page has a link to Older Versions which just takes you to the SourceForge file host. Navigating from there to Octave Forge Packages, individual package releases, will give you a chronological package download list where you can find different control packages to try. Scroll down or do a Find for 'control' and you should see 3.0.0 there.

Error using plotly in Rstudio - unused argument plot$data

Even while using the sample code given in ggplotly help function... I'm continuously getting the below error
Error in map_layout(panel, plot$facet, layer_data, plot$data) :
unused argument (plot$data)
I had the same issue and followed the solution suggested by #royr2. Specifically, I installed the development version of plotly using devtools::install_github("ropensci/plotly") and restarted my R session and reloaded the package. After that, ggplotly worked again in RStudio.
I know this isn't an answer per se, but this has been documented as known issue with ggplot 2.1.0 - see link:
https://github.com/ropensci/plotly/issues/481

R studio graph not appearing in plots window

I am having trouble getting my graphs to appear in the 'plots' window of R studio - once I run the script they appear in a separate R graphics window, separate to R Studio, with the 'plots' tab blank.
Is there a setting or code I should use to change this?
Thank you in advance,
This has been a consistent problem for many users ever since the last couple updates, myself included. It was apparently fixed with 3.5 version of R, which I haven't updated to, but you didn't mention which version you are running.
Either way, if you're running the most updated version or not, try getOption("device") and check the output of that. Per an R support community post, if the output does not say RStudioGD, you can use options(device = "RStudioGD").
The NEXT, and more annoying, solution was to uninstall and reinstall RStudio. Many people found that this solved their problem.
If neither of those work work, the only other solution that people were finding is to downgrade your R version to a compatible version unfortunately! It's really annoying, I know!
Hope I could help!

R syntax highlighting in Terminal

Can we get syntax highlighting for R in the Terminal?
I've finally found a library that meets my needs.
Now I'm much happier with my coding environment.
colorout is an R package that colorizes R output when running in a terminal emulator.The package cannot be on CRAN because it changes code already loaded by R and this is prohibited by the CRAN Repository Policy. The package replaces the functions that output results and messages to R Console, and this is necessary because we cannot colorize the output without replacing these functions. To install it, do the following in R:
install.packages("devtools")
devtools::install_github("jalvesaq/colorout")
library("colorout")
# do something
Use something like ess on emacs or RStudio for syntax highlighting for R instead of expecting it to work in the terminal.
Another option now would be to use radian instead of the default R prompt.
As hd1 indicated, this is not an R question. You're asking the OSX Terminal.app to do something it's not capable of. A quick look around Google (happy Zamboni birthday!) shows Vim syntax Highlighting for highlighting within vim , or https://superuser.com/questions/72057/terminal-emulator-with-custom-color-palette , but dunno if these will run under Darwin.
EDIT: I can't stay away from the search :-) . So check out these threads: https://superuser.com/questions/400360/syntax-highlighting-in-terminal-mac-os-x , http://forums.macrumors.com/showthread.php?t=412609 , and a recommendation to install zsh , https://apple.stackexchange.com/questions/12161/os-x-terminal-must-have-utilities

Resources