Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure_axisY title error #3343

Open
Liripo opened this issue Feb 27, 2024 · 3 comments
Open

configure_axisY title error #3343

Liripo opened this issue Feb 27, 2024 · 3 comments
Labels

Comments

@Liripo
Copy link

Liripo commented Feb 27, 2024

Use configure_axisY to modify the y-axis title, but the it becomes empty.

import altair as alt

# load a sample dataset as a pandas DataFrame
from vega_datasets import data
cars = data.cars()

# make the chart
chart = alt.Chart(cars).mark_point().encode(
    x='Horsepower',
    y='Miles_per_Gallon',
    color='Origin',
).interactive()

chart.configure_axisY(title="test")

image

altair version is '5.1.1'

@Liripo Liripo added the bug label Feb 27, 2024
@afonit
Copy link
Contributor

afonit commented Feb 28, 2024

@Liripo, I have searched and I am not seeing it documented anywhere that title can be passed to configure_axisY, I may be missing where it says that.

Not sure if you are looking for a work-around or alternative way to achieve what you wrote, but this will get it done:

import altair as alt

# load a sample dataset as a pandas DataFrame
from vega_datasets import data
cars = data.cars()

# make the chart
chart = alt.Chart(cars).mark_point().encode(
    x='Horsepower',
    y=alt.Y('Miles_per_Gallon').title('Miles Per Gallon'),
    color='Origin',
).interactive()

@Liripo
Copy link
Author

Liripo commented Feb 29, 2024

@afonit I saw here https://altair-viz.github.io/user_guide/configuration.html#config-axis:
image

I want to modify the axis title after the graph is drawn. Is there any other way?

@debbes80
Copy link

Using configure_axisYQuantitative instead seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants