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

axvline, axhline, shade_between #27

Open
arsenovic opened this issue Jul 15, 2014 · 9 comments
Open

axvline, axhline, shade_between #27

arsenovic opened this issue Jul 15, 2014 · 9 comments

Comments

@arsenovic
Copy link

i use these functions frequently to highlight regions of interest, bounds, etc.

are there any plans to support these in mpl_exporter/plotly/mpld3. im not familiar enough with the architecture to know where exactly the information is being lost.

@theengineear

@theengineear
Copy link
Contributor

Yup. Plotly has been mostly trying to deal with visualizing actual data, but having objects on a plot can definitely assist in understanding the data. This will soon be added on the Plotly side.

We're actually going to be helping out with some matplotlib development for 1.5.x to refactor how figure representations are exported there. Currently, it's impossible for us to know whether a line in a matplotlib plot is data or extra information. However, once this refactor is done, the high-level plot semantics will be included and we'll be able to properly handle this conversion.

I'll leave this open, but this probably won't see much improvement for a month or so while this project gets up an running. I'll definitely post something here when these things are better handled.

@arsenovic
Copy link
Author

nice. thanks

@bryevdv
Copy link

bryevdv commented Jul 15, 2014

@theengineear please ping me (@bryevdv) or @damianavila if we can help out.

@theengineear
Copy link
Contributor

@bryevdv, will do! I expect to start working on this project end of this week or early next.

@jakevdp
Copy link
Contributor

jakevdp commented Jul 15, 2014

The problem with axhline and axvline is that they involve blended transforms: that is, one direction follows the data, while one direction is attached to the screen coordinates. Without a full-featured transformation representation, they will be very difficult to add to mplexporter or the derived projects. Plotly might be able to do this (I'm not sure), but I don't see mpld3 getting there any time soon, unless someone has some significant time to invest in it.

When you say "shade_between", do you actually mean "fill_between"? If so, that's already supported in mpld3.

@aflaxman
Copy link
Contributor

How about sticking a “x follows data” flag of some sort in the json, and then mpld3 can continue to do it wrong until someone gets around to using it?

@theengineear
Copy link
Contributor

@jakevdp, is the problem in mplexporter from matplotlib in that you can't run something like contains_branch on the transformation? I.e., is it that it's (1) not possible at all to know what the blended transformation is, or (2) that there's no usable subset of blended transformations that the current projects could leverage?

Right now Plotly can anchor to x in one dimension and what we call paper in another. However, like I said, there's not yet support for arbitrary objects (e.g., a horizontal line).

@danielballan
Copy link
Contributor

Related: MEP 25

@jakevdp
Copy link
Contributor

jakevdp commented Jul 16, 2014

I ran into some problems with contains_branch earlier - it only works for instantiated transforms, not transform classes. This means you can't just do contains_branch(BlendedTransform): you actually have to check for an instantiated BlendedTransform, but if you had access to that, you wouldn't have to check the branch for it!

Anyway, there's nothing fundamentally that keeps you from getting mixed transform information from matplotlib: it's just that we haven't implemented that yet. Implementing that would take some careful thought regarding the design, though, so that we don't code ourselves into a corner later on.

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

No branches or pull requests

6 participants