Comments (4)
Question 1:
You have to pass the order explicitly in xlim. See #206.
library(rbokeh)
# total yield per variety
figure(xlim = levels(lattice::barley$variety)) %>%
ly_bar(variety, yield, data = lattice::barley, hover = TRUE) %>%
theme_axis("x", major_label_orientation = 90)
Question 2:
Maybe a problem of version. I don't have the issue with rbokeh_0.5.0
.
from rbokeh.
I thought my answer would be enough to guide you. Instead of using the levels as above, you just have to provide the order you want. How to compute this order is a general R question.
Below is an an example, using data.table
for convenience.
library(data.table)
library(rbokeh)
barley <- setDT(lattice::barley)
varieties <- barley[, sum(yield), by = variety][
order(-V1), as.character(variety)]
# total yield per variety
figure(xlim = varieties) %>%
ly_bar(variety, yield, data = barley, hover = TRUE) %>%
theme_axis("x", major_label_orientation = 90)
from rbokeh.
Thank you Atrebas, your comment was helpful, but what I want is to order x axis by y axis value in decreasing order.
For example, the first x axis data should be Trebi, Wisconsin No.38, because they have the greatest yield, and next No.457, and No.462 ...... and so on, like below
How can I do this?
from rbokeh.
Thank you Atrebas, I've got a solution thanks to your help.
I simply converted columns to factors and set it xlim.
Now it works well!
from rbokeh.
Related Issues (20)
- grid_plot width is not dynamic HOT 2
- Update for Bokeh 1.0 HOT 12
- Can I serve rbokeh apps with rbokeh server? HOT 2
- Enable Click Policy HOT 1
- ly_multi_line doesn't render any lines HOT 1
- legend_orientation in figure()
- Hover doesn't work when x and y is flipped HOT 5
- indefinite loading time of some plots HOT 5
- Functionality that mimics "span" in bokeh HOT 1
- Importing plot from ggplot2 directly into rbokeh?
- Legend outside graphs? Or next to graphs? HOT 1
- could not find function "ly_abline" HOT 8
- Legend Title
- rbokeh has been removed from CRAN HOT 8
- parameter "image_url" in ly_image_url() not work for local image HOT 2
- lname seeems to prevent glyphs from working HOT 2
- rbokeh compatibility with crosstalk? HOT 1
- LaTeX or expressions in figure labels HOT 6
- Archive this repository? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbokeh.