add vertical line faceted chart
See original GitHub issueHello, I’m struggling with something that I can’t solve. let’s say we have the example from the Becker’s Barley Trellis Plot https://altair-viz.github.io/gallery/beckers_barley_trellis_plot.html What I want to do is add a dashed vertical line from x=30 so I can easily see if the value from the plots i over or under that value.
thanks!
import altair as alt
from vega_datasets import data
source = data.barley()
alt.Chart(source).mark_point().encode(
alt.X('median(yield)', scale=alt.Scale(zero=False)),
alt.Y(
'variety',
sort=alt.EncodingSortField(field='yield', op='median', order='descending'),
scale=alt.Scale(rangeStep=20)
),
color='year:N',
row='site'
)
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (12 by maintainers)
Top Results From Across the Web
Add Different Line to Each Facet of ggplot2 Plot (R Example)
How to draw different lines to a ggplot2 facet plot in R - R programming example ... Currently, our plot does not contain...
Read more >How to add different vertical lines on specific plots of the two ...
My question is how to add different vertical lines for different plots in the facets? For example, putting xintercept=c(10,20) on the left two ......
Read more >How to create facets in vertical order using ggplot2 in R?
First of all, create a data frame. · Then, create facetted plot with facet_grid function. · After that, create the facetted plot with...
Read more >How to create a faceted line-graph using ggplot2 in R
In ggplot2, geom_line() function is used to create a line graph. ... This will return vertical facets on the plot and to draw...
Read more >Faceting with ggplot2 - The R Graph Gallery
facet_wrap() is the most common function for faceting with ggplot2 . It builds a new chart for each level of a categorical variable....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was finally able to draw a vertical line on my Altair’s plots following the suggestions from above—thank you for that!—but I wonder if it would be possible to implement
matplotlib
’shlines
andvlines
or something likeggplot
’s+ geom_vline(xintercept=2)
too. It would make this library so much more intuitive and easy to use!I do like the library very much and thank @jakevdp and the other contributors for the amazing job you have done with it. 🙌
Hello dear @vtnate for add a line to date in the chart, you should add the new rule to chart code. for shading read here