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 plots #57

Open
fishrockz opened this issue Jan 12, 2020 · 4 comments
Open

Contour plots #57

fishrockz opened this issue Jan 12, 2020 · 4 comments

Comments

@fishrockz
Copy link

I notice in #3 that @milliams is keen for lots more plot types

A plot I use a lot in matplotlib is the contour plot, i have some ideas as to how to do this in plotlib but before i get too carried away do you have firm ideas as to how to handle this sort of thing?

Would you welcome a PR adding such a plot?

PS I have been really enjoying using your lib so far, thanks to all involved!

@fishrockz
Copy link
Author

I have been creating a little app that uses druid and this lib, druid has a nicely scaling svg widget but did not render plotlib graphs properly, I got a PR merged in druid to allow that and am working on a branch to also allow embedded images.

With that merged i will be able to use a branch of this lib to create things like
Screenshot from 2020-01-23 23-56-21

The branch of plotlib i have been working on is https://github.com/fishrockz/plotlib/tree/willsalmon/imshow it is still very ruff and ready but i was wondering how keen others would be on having this? If there is interest then I would like to clean it up and get it merged here. It dose not create contour plots but creates things more like matplotlib imshow()

I would still like to add contour plot functionality but its a fair bit more complex than imshow.

@milliams
Copy link
Owner

I think that an imshow style feature would be welcome if we can integrate it in well.

For contour plots I think we could do something a bit cleverer and generate the contours automatically as part of the pipeline but apart from that an generic imshow feature could cover a lot of use cases.

@fishrockz
Copy link
Author

So I implemented this first time with lots of rect's and it scalled very badly (I mean it was supper slow to to write them all out and then read them back in to something else)
My second go was to embbed a png image inside the svg as raw bytes encoded to base64. this worked ok but while embedded images are implemented in most renders lots of them rendered them slightly differently especially if the aspect ratio of the axis did not match that of the underlying data.

@milliams
Copy link
Owner

From a quick look around, it seems that matplotlib generates the contour lines themselves as (a group of) vector <path> objects and the colours backing it as an <image>.

For example see https://docs.astropy.org/en/stable/visualization/wcsaxes/images_contours-3.svg

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