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

Support Measures units more in x,y scales #1512

Merged
merged 1 commit into from
Jan 18, 2021

Conversation

Mattriks
Copy link
Member

@Mattriks Mattriks commented Jan 16, 2021

  • I've updated the documentation to reflect these changes
  • I've added and/or updated the unit tests
  • I've run the regression tests
  • I've built the docs and confirmed these changes don't cause new errors

This PR

  • adds more support for Measures units in x,y scales
  • fixes a mistake in function cat_aes_var!

Example

  • Add text at relative positions on a plot
using DataFrames, Gadfly
import Gadfly: w, h

df = DataFrame(x=[0.6w, 0.6w], y=[0.6h, 0.7h], label=["Text 1", "Text 2"])
layer1 = layer(x=1.0:5, y=[0.21, 0.81, 0.68, 0.76, 0.18], Geom.point)
layer2 = layer(df, x=:x, y=:y, label=:label, Geom.label(position=:right))
layer3 = layer(xintercept=[2cm], Geom.vline(color="orange"))

p1 = plot(layer1, layer2, layer3, Guide.title("Scale.x_continuous"))
p2 = plot(layer1, layer2, layer3, Scale.x_discrete, Guide.title("Scale.x_discrete"))
hstack(p1, p2)

Plot04

@Mattriks Mattriks merged commit af23b41 into GiovineItalia:master Jan 18, 2021
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.

1 participant