-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
How to change Curves axis ranges? #1717
Comments
Agreed, this deserves more discussion and at minimum a major section in the documentation. I think what you are looking for is the %%opts Curve {+framewise}
hv.DynamicMap(lambda i: hv.Curve(np.arange(i)), kdims=['i']).redim.range(i=((10, 20))) Using the hv.DynamicMap(lambda i: hv.Curve(np.arange(i)), kdims=['i']).redim.range(i=((10, 20))).opts(norm=dict(framewise=True)) |
Thank you, didn't know that existed, but it worked for me! I'm new to HoloViews, and actually the live plotting is what drove me to Bokeh, which led to HoloViews. The streaming functionality is a big pro, especially because it seems that Matplotlib doesn't have very good options and Plotly is either non-offline or paid. |
That's our fault and we'll have to make this more obvious or find a more obvious way to control this. Great to hear HoloViews is addressing your problems. If you run into more issues please don't hesitate to file issues or ask us a question on Gitter. |
@philippjfr So is this not something that can be passed directly into a function or into an %%opts magic? If I read @nikhilxb 's question correctly, this seems to be intuitive disconnect, that something like axis ranges are not a customisation option I can access directly as I can line_color, width, etc. I would never have thought of looking into .redim.range() ... ... also ... recently started using HoloViews, and I think your work and ideas on this are great. |
@maegul Sorry for the delay on my reply, that is a sensible point and I would not actually object to adding explicit range plot options, particularly once we have completely deprecated the |
I think Charts need a first class way to set their Axes ranges. A Chart is a "view" on some dimensions/metrics that are part of a data "model". To make the idea of Inherit/Infer more general, think of the this transformation from model to view as something an advanced user needs to have control, i.e. a user defined function. For example, the Y-axis range should "go from 0 to the 95%-tile of the data values". The default behavior is for the Chart to inherit the axis range from the dimension, but the advance user should be able to override this behavior. Maybe the generic transformation between model and view attributes could be handled by the proposed "op" functions #2152 |
I'd also be glad to be able to explicitly set the limits on the axes; I was surprised I couldn't find a way to do that with |
The next release will have an option for dimension range padding: #2293 |
I've still not been able to find out how to set limits for the default plotting ranges - I don't understand how this "framework" method is supposed to work? Maybe this could be something that you could also address in "Customizing Plots" where no explicit example is given? Say for the example:
ranges for x: (-4,4), ranges for y: (-1.5,1.5). |
Ok, finally figured it out.
I still think an explicit example should be given in "Customizing Plots"! |
Totally agree with you on Customizing plots having a section on this. Also note that
hv.Curve((xs, xs/3), 'xdim', 'ydim').redim.range(xdim=(-4, 4), ydim=(-1.5, 1.5))
hv.Curve((xs, xs/3), 'xdim', 'ydim').options(xlim=(-4, 4), ylim=(-1.5, 1.5)) |
Any chance the |
They will be yes. The semantics of xlim/ylim are such that setting it on any Element in an Overlay will override the ranges on any other Element in that Overlay, and setting it on the Overlay itself overrides everything. |
This has been documented in FAQ items and in the docs now. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I've been trying for hours to figure out how to change the x-axis range dynamically (with a DynamicMap). But nowhere on the user guide can I find examples of how to do this! It seems like it should be the easiest thing.
The text was updated successfully, but these errors were encountered: