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

Add stairs plot #1086

Merged
merged 4 commits into from
Jul 1, 2021
Merged

Add stairs plot #1086

merged 4 commits into from
Jul 1, 2021

Conversation

sethaxen
Copy link
Contributor

This PR adapts @jkrumbiegel's implementation of a stairs plot in https://gist.github.com/jkrumbiegel/529936a3a6f158715343601d9487880b.

Example:

f = Figure()
x = 1:10
y = 11:20
f[1, 1] = Axis(f; title="step=:pre")
stairs!(f[1, 1], x, y)
f[2, 1] = Axis(f; title="step=:post")
stairs!(f[2, 1], x, y; step=:post)
f[3, 1] = Axis(f; title="step=:center")
stairs!(f[3, 1], x, y; step=:center)
f

tmp

@sethaxen
Copy link
Contributor Author

sethaxen commented Jul 1, 2021

Additional options we could add:

  • ability to style vertical and horizontal segments differently
  • ability to provide a marker and marker style options to simultaneously scatter

@jkrumbiegel jkrumbiegel merged commit 486b466 into MakieOrg:master Jul 1, 2021
@sethaxen sethaxen deleted the stairs branch July 1, 2021 14:35
@lazarusA
Copy link
Contributor

lazarusA commented Jul 2, 2021

this other case will also be so useful... (histstep)

https://gist.github.com/jkrumbiegel/5baa32d0c010cb842e037603a18663cd

@sethaxen
Copy link
Contributor Author

sethaxen commented Jul 2, 2021

Probably the simplest thing to do for histstep would be to factor the histogram creation code in hist into its own helper function, and then the difference between hist and histstep is only the attributes and whether it calls barplot! or stairs! internally.

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

Successfully merging this pull request may close these issues.

4 participants