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 Legend issues #22

Open
chaosphere2112 opened this issue Oct 12, 2016 · 4 comments
Open

VCS Legend issues #22

chaosphere2112 opened this issue Oct 12, 2016 · 4 comments
Assignees
Labels
bug high Highest priority issue
Milestone

Comments

@chaosphere2112
Copy link
Contributor

Looks like there are a couple of issues with the legend (at least when using boxfill).

This notebook illustrates most of the issues I found, but I'll break it down individually as well.

boxfill.legend label placement is wrong

When you assign values to it, it should use that dictionary to draw tickmarks on the legend at the appropriate point for the values used as the keys; this should work fine:

import vcs
box_data = [range(0, 100, 20) for _ in range(5)]
boxfill = vcs.createboxfill()
boxfill.boxfill_type = "custom"
boxfill.levels = [0, 10, 30]
boxfill.legend = {1: "one", 16: "sixteen", 25: "twentyfive"}
x = vcs.init()
x.plot(box_data, boxfill)

legend_placement

Legend will draw as many sections as it can

When you have more fillarea* items than levels, weird stuff starts to happen with the legend (though the data looks fine).

import vcs, cdms2
x = vcs.init()
f = cdms2.open(vcs.sample_data + '/clt.nc')
s = f('clt')
box = vcs.createboxfill()
box.boxfill_type = "custom"
box.fillareacolors = [1, 2, 3, 4]
box.fillareaindices = [2, 3, 4, 5]
box.fillareastyle = "hatch"
box.levels = [0, 50, 100]
x.plot(s, box)

wat

At some point I was also able to make legend sections draw over themselves, but I haven't been able to reproduce that one yet.

@aashish24
Copy link
Contributor

@chaosphere2112 okay if @danlipsa look into this?

@chaosphere2112
Copy link
Contributor Author

@aashish24 Yup, that's fine with me. I don't really work on VCS proper anymore, besides miscellaneous bug fixes I need in a hurry.

@doutriaux1 doutriaux1 modified the milestone: 3.0 May 5, 2017
@doutriaux1 doutriaux1 modified the milestones: 3.0, post 3.0 Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
@doutriaux1
Copy link
Contributor

First one is fixed second one is still true, even weirder when plotting the data is first REALLY weird but x.png fixes it

@scottwittenburg
Copy link
Collaborator

This can be fixed where we draw the legend.

@scottwittenburg scottwittenburg added the high Highest priority issue label May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug high Highest priority issue
Projects
None yet
Development

No branches or pull requests

5 participants