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

VCS boxfill - cannot set levels #876

Closed
painter1 opened this issue Nov 6, 2014 · 3 comments
Closed

VCS boxfill - cannot set levels #876

painter1 opened this issue Nov 6, 2014 · 3 comments

Comments

@painter1
Copy link
Contributor

painter1 commented Nov 6, 2014

The following demonstrates that you cannot set the levels in a boxfill plot. It works with isofill.
What I would expect to see is a contour legend with colors ranging from 0 to 2, and only half the colors actually used. What I get is a legend with colors ranging from 0 to 1, and all colors used.

import vcs
v=vcs.init()
import numpy
a=numpy.random.random((10,10))
levels=vcs.mkscale(0,2)
levels
[0.0, 0.20000000000000001, 0.40000000000000002, 0.59999999999999998, 0.80000000000000004, 1.0, 1.2, 1.3999999999999999, 1.6000000000000001, 1.8, 2.0]
a.min(),a.max()
(0.013234570510233579, 0.99400848900885075)
gm=vcs.createboxfill()
gm.levels=levels
v.plot(a,gm)

@painter1
Copy link
Contributor Author

painter1 commented Nov 6, 2014

This may be the same as issue 869, but I can't figure out what exactly that issue is.

@doutriaux1
Copy link
Contributor

are you using master? I believe this is fixed in master and you are right this looks the same at #869

@doutriaux1
Copy link
Contributor

@painter1 turns out you need to set the boxfill type in order to turn on levels otherwise by default it uses level_1/2

gm.boxfill_type="custom"

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

No branches or pull requests

2 participants