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

repeatedly add same vlines and hlines to same plot, in a theme almost #1507

Closed
SimonEnsemble opened this issue Jan 3, 2021 · 2 comments
Closed

Comments

@SimonEnsemble
Copy link

hi!
I want to add spines to my Gadfly plots, as a sort of theme. is there any way around passing the last two lines every time I make a plot?

spines = [Geom.vline(color="light gray", size=0.5mm), Geom.hline(color="light gray", size=0.5mm)]

plot(data, x=:t, y=:output, Geom.line,
      xintercept=[0.0], yintercept=[0.0], 
      spines...)

I am sort of asking if I can somehow use push_theme to achieve this. thanks!

@Mattriks
Copy link
Member

Mattriks commented Jan 3, 2021

Not via Theme, but you can simplify the above plot by defining a layer first:

layer0 = layer(xintercept=[0.0], yintercept=[0.0],
    Geom.vline(color="light gray", size=0.5mm), Geom.hline(color="light gray", size=0.5mm))

plot(..., layer0)

@SimonEnsemble
Copy link
Author

👍 thank you!

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

No branches or pull requests

2 participants