Is there a way to rotate the y-axis label and sit in the upper left corner?
See original GitHub issueMany news charts rotate the y-axis label so it can be read left to right and lift it to sit above the top of the axis. I’ve roughly recreated this in Altair, but longer axis titles generate this bug. Any idea how to fix it? I don’t see a text anchor setting in Vega-Lite I can use.
import altair as alt
from vega_datasets import data
source = data.iowa_electricity()
alt.Chart(source, title="Iowa's renewable energy boom").mark_line().encode(
x=alt.X(
"year:T",
axis=alt.Axis(title="Year")
),
y=alt.Y(
"net_generation:Q",
title="Net generation (in thousand megawatthours)",
),
color=alt.Color(
"source:N",
legend=alt.Legend(title="Electricity source"),
)
).configure_axisY(
titleAngle=0,
titleY=-10,
titleX=-10,
)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
BarChart: Want to rotate and place a y-axis label on the left side
I would like to know if it's posible to place the y-axis label roated on the left side without using Frame->True and FrameLabel->...
Read more >Rotating axis labels in R plots - Tender Is The Byte
A detailed look at how to rotate axis labels in base R plots.
Read more >Quick and easy ways to deal with long labels in ggplot2
First we can rotate the labels a little. Here we rotate the labels 30°, but we could also do 45°, 90°, or whatever...
Read more >Origin Help - Graph Axes - OriginLab
For information on... These customizations... See these topics in the Origin Hel...
Major tick labels Show/hide labels on major ticks Tick Labels tab
Major tick...
Read more >Rotating shapes (video) - Khan Academy
Sal is given a triangle on the coordinate plane and the definition of a rotation about ... Is there an easier way or...
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 guess I can close the ticket now. I doubt anyone cares, but IMHO this should be the y-axis’s default title position. Commonplace in media. Much more legible.
Looks like there’s an axis setting now called
titleAlign
. If I put “left” in there it seems to work.