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

Tick lines #29

Open
jonocarroll opened this issue Dec 6, 2019 · 6 comments
Open

Tick lines #29

jonocarroll opened this issue Dec 6, 2019 · 6 comments

Comments

@jonocarroll
Copy link
Owner

Tick lines anything... Changing them removing them.

-- https://twitter.com/VizMonkey/status/1202293678364135425?s=20

@DataStrategist

Do you mean add/remove ticks or grid lines? Both would be suitable.

@jonocarroll
Copy link
Owner Author

Removing:

library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) +
    geom_point() + ggeasy::easy_remove_x_axis(what = "ticks")

Created on 2019-12-06 by the reprex package (v0.3.0)

How would you like to change them? Add more? Rotate?

@DataStrategist
Copy link

first of all.....amazing? WTF youre my idol!

So there's 3 things I want to do frequently: Remove everything from both axes (numbers and ticklines), change the heavy interval (to go by 10s or 1s or whatev), and 3, easy rotate them.

While I'm here I might also give you an idea I had and never built. What if we thought of a plot by pieces, so to have a function called y_axis(title, ticks, interval, labels, font, color, angle). And another one for x. The inputs would represent:

  • title = the title of the axis. Either TRUE (would default to whatever it should be), FALSE to omit, or "boom" to override
  • ticks = T/F
  • interval = where should the heavy interval fall?
  • labels = T/F
  • font = a font override like "Garamond 24"? Maybe allowing size etc in here too? Dunno
  • color = replace tick and label color
  • angle = text rotation for the angle text

Wouldn't that solve most needs? That way we could have:

ggplot(boom, aes()) + labs() + ggeasy::y_axis() + ggeasy::x_axis()

to handle most customizations (except for color but that's another mess). What do u think?

@jonocarroll
Copy link
Owner Author

Remove everything:

library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) +
    geom_point() + ggeasy::easy_remove_axes(what = c("ticks", "text", "title"))

Gridlines are on the roadmap, probably an easy_remove_gridlines (see also #31).

Rotate x axis:

library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) +
    geom_point() + ggeasy::easy_rotate_x_labels(angle = 45, side = "right")

As for changing the intervals, I'll work on that.

I'll have a think about easy_x_axis and easy_y_axis functions - seems like it could work.

@DataStrategist
Copy link

Hi Jon! I was going to open another issue but then realized I had already mentioned about easy-change-intervals.

I also just reread about my idea for x_axis, y_axis... I do think it's kind of cool and might want to build it. Would you appreciate a friendly PR?

I also do understand that it might be confusing to have different grammars in your package. If you don't want that crap in here, no worries I can build it separately.

@yonicd
Copy link
Collaborator

yonicd commented Apr 14, 2020

tick line manipulation is also avail via ggalt

@DataStrategist
Copy link

Oh indeed... thanks @yonicd I guess that takes care of the ticks... so only the convo about the x_axis/y-axis functions remain... then this ticket can be closed.

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

No branches or pull requests

3 participants