Skip to content

Changing the axis title #105

@jwhendy

Description

@jwhendy

Hello,

I'm coming from R + ggplot2 and I'm not sure what I'm doing wrong here to change the axis title.

from plotnine import *
from plotnine.data import *
p = ggplot(aes(x='displ', y='cty'), mpg) + scale_x_continuous(name="foo")
p + geom_point()

2018-01-06_222203

From the docs

class plotnine.scales.scale_x_continuous(**kwargs)
name (str, optional) -- Name used as the label of the scale. This is what shows up as the axis label or legend title.


R equivalent:

library(ggplot2)
data(mtcars)

ggplot(mtcars, aes(x=disp, y=mpg)) + geom_point() + scale_x_continuous(name="foo")

2018-01-06_222650

Thanks for taking a look, and sorry if I've misunderstood due to being new to plotnine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions