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

Fix color assignment in 2D Histogram (Fix #310) #314

Merged
merged 1 commit into from
Jun 5, 2014
Merged

Fix color assignment in 2D Histogram (Fix #310) #314

merged 1 commit into from
Jun 5, 2014

Conversation

darwindarak
Copy link
Collaborator

I think color information in the 2D histogram is being stored in row-major order, while the bincounts are stored in column-major order.

xdat = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
ydat = [0, 0, 0, 2, 2, 2, 4, 4, 4, 2]
plot(x=xdat,y=ydat, Geom.histogram2d(xbincount=5, ybincount=5))

Gives the following
672a6d8
as opposed to
transposed

This might not be the best way to fix this, but transposing bincounts before assigning the color values seems to work. So

plot(x=randn(100000),y=randn(100000), Geom.histogram2d(xbincount=100,ybincoun
t=100))

Now correctly shows

transposed-2d-gaussian

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling dc74ad5 on darwindarak:master into 672a6d8 on dcjones:master.

dcjones added a commit that referenced this pull request Jun 5, 2014
Fix color assignment in 2D Histogram (Fix #310)
@dcjones dcjones merged commit 3c3ff0d into GiovineItalia:master Jun 5, 2014
@dcjones
Copy link
Collaborator

dcjones commented Jun 5, 2014

Great, thanks for fixing this!

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.

None yet

3 participants