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

Geom.rect #993

Merged
merged 1 commit into from
Apr 30, 2017
Merged

Geom.rect #993

merged 1 commit into from
Apr 30, 2017

Conversation

Mattriks
Copy link
Member

@Mattriks Mattriks commented Apr 29, 2017

Two instances of RectangularBinGeometry are necessary:

  • Geom.rectbin which calls Stat.rectbin (takes x & y aesthetics)
  • Geom.rect which calls Stat.Identity (takes xmin, ymin, xmax, ymax)

The former currently exists, this PR adds the latter, and fixes issues #771 & #845.
Note the name Geom.rect is used rather than Geom.rectangle to avoid conflicts with Compose.rectangle (which is widely used without the package specifier in Gadfly code).

Here is an example:

theme1 = Theme(default_color=RGBA(0, 0.75, 1.0, 0.5))
D = DataFrame(x=[0.5,1], y=[0.5,1], x1=[0,0.5], y1=[0,0.5], x2=[1,1.5], y2=[1,1.5])
pa = plot(D, x=:x, y=:y, Geom.rectbin, theme1)
pb = plot(D, xmin=:x1, ymin=:y1, xmax=:x2, ymax=:y2, Geom.rect, theme1)
hstack(pa, pb)

issue845a

@codecov-io
Copy link

codecov-io commented Apr 29, 2017

Codecov Report

Merging #993 into master will increase coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #993      +/-   ##
==========================================
+ Coverage   78.99%   79.12%   +0.12%     
==========================================
  Files          33       33              
  Lines        4057     4058       +1     
==========================================
+ Hits         3205     3211       +6     
+ Misses        852      847       -5
Impacted Files Coverage Δ
src/geom/rectbin.jl 80.55% <100%> (+9.12%) ⬆️
src/Gadfly.jl 74.02% <0%> (+0.25%) ⬆️
src/coord.jl 84.46% <0%> (+0.97%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13eba8b...bd0a78d. Read the comment docs.

@bjarthur
Copy link
Member

ggplot uses geom_rect and geom_tile. should we follow suit?

http://ggplot2.tidyverse.org/reference/geom_tile.html

@Mattriks
Copy link
Member Author

Mattriks commented Apr 29, 2017

I prefer Geom.rectbin (rather than Geom.tile), and I don't think we should always follow suit.

@bjarthur
Copy link
Member

i find Geom.rectbin confusing given that it doesn't actually bin the data, like Geom.hexbin does.

@Mattriks
Copy link
Member Author

My suggestion is to open a new issue about the naming of Geom.rectbin if you want to change it.

@bjarthur bjarthur merged commit f999348 into GiovineItalia:master Apr 30, 2017
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.

3 participants