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

Contour quantization does not support negative numbers. #2994

Closed
5 tasks done
yuicer opened this issue Dec 8, 2020 · 12 comments · Fixed by #2995
Closed
5 tasks done

Contour quantization does not support negative numbers. #2994

yuicer opened this issue Dec 8, 2020 · 12 comments · Fixed by #2995
Labels
bug For bugs or other software errors

Comments

@yuicer
Copy link

yuicer commented Dec 8, 2020

Please:

  • Check for duplicate issues. Please file separate requests as separate issues on GitHub.
  • Clearly describe the goal of the feature request. Why is it needed?
  • Describe an envisioned solution. What do you want the new behavior to be?
  • If applicable, share mockup images or links to examples illustrating the desired output.
  • If applicable, share JSON spec designs for how the behavior would be made available in Vega.

I want to mark a mountain height chart through contour. but can not get the trough part when I put a negative number into weight. and there will be a big hole. and the hole will become confused when I mark the negative number bigger

so how can I mark the correct charts through [KDE2d, Isocontour] transform?

demo link

image
image

@yuicer yuicer added the feature-request For requesting new features or transforms label Dec 8, 2020
@yuicer
Copy link
Author

yuicer commented Dec 8, 2020

@domoritz @jheer

@roying
Copy link

roying commented Dec 8, 2020

Try changing the value of the negative weight (e.g. -40 instead of -160):

screenshot_vega_contours

@yuicer
Copy link
Author

yuicer commented Dec 9, 2020

Try changing the value of the negative weight (e.g. -40 instead of -160):

screenshot_vega_contours

yeah,that did work just for this [-40] data. but I can not justify all the data to a proper value?

and I should not change the data I want to show to make the chart looks good

@mattijn
Copy link
Contributor

mattijn commented Dec 9, 2020

The chart is based on the data you provide.. Can you please elaborate what you mean with correct chart. It's hard to understand what you are looking for.

@jheer jheer added documentation For documentation-related issues and removed feature-request For requesting new features or transforms labels Dec 9, 2020
@jheer
Copy link
Member

jheer commented Dec 9, 2020

I believe the core issue here is that the weight value is assumed to be strictly positive. At minimum, we should update the documentation to reflect this.

@jheer jheer changed the title contour charts can not display trough part KDE2D does not support negative weights. Dec 9, 2020
@yuicer
Copy link
Author

yuicer commented Dec 9, 2020

@mattijn

sorry for the bad English :(

just like the picture below. [this is matplotlib contour example]

I want to describe the mountain height and includes these below sea level parts

In one word. I want to modify the sea level. Maybe just like the area charts based on y2: {value: 0}

image
image

and this is another mountain pic

image

@yuicer
Copy link
Author

yuicer commented Dec 9, 2020

@jheer yeah!that is the core!
the weight can't be a negative number

so how can I do something like this?
image

@jheer jheer added bug For bugs or other software errors and removed documentation For documentation-related issues labels Dec 9, 2020
@jheer jheer changed the title KDE2D does not support negative weights. Contour quantization does not support negative numbers. Dec 9, 2020
@jheer
Copy link
Member

jheer commented Dec 9, 2020

Thanks @yuicer! I was able to dig deeper and it turns out the KDE2D output is OK, even with negative weights (assuming the count: true parameter is used). There is however an error in one of the utility methods used by the Isocontour transform to infer the contour thresholds. I've re-labeled this as a bug so we can fix it. In the meantime, if you provide your own thresholds array parameter as input to Isocontour you will be able to get proper contour lines.

@yuicer
Copy link
Author

yuicer commented Dec 9, 2020

@jheer

I've read the pr and have a try. it did have a better display. but still, a hole can't be removed

so... do this pr is the final fix? the hole here is needed?

@jheer
Copy link
Member

jheer commented Dec 9, 2020

Hi @yuicer, apologies but I don't think I'm understanding you. What do you mean by "the hole here is needed?"?

The PR should provide a proper set of uniform steps between the min and max values found within the input grid of values produced by KDE2D, and use those as the default contour thresholds. You can always provide custom threshold levels if there are specific contours you would like to have included.

@yuicer
Copy link
Author

yuicer commented Dec 10, 2020

@jheer sorry for my bad English...
I mark a repo demo here

the red line part is the 'hole'

thanks for your advice. Anyway I'll try threshold params

image

@yuicer
Copy link
Author

yuicer commented Dec 10, 2020

would it better to return range(start, stop, step)?
#2995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For bugs or other software errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants