-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Setting only min or max values for axis and not a range. #400
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
Comments
Thanks for submitting the issue. You're making some valid points. Any company out there able to sponsor this work? https://plot.ly/products/consulting-and-oem/ |
I'd like to add comments to this: it is especially desirable when displaying bar charts that are meant to represent performance against a maximum, otherwise the automatic sizing creates visually misleading results. since tickmode/tickvals when used together can be used to explicitly name tick points, perhaps adding another option to make those values fixed would be a viable feature? |
This feature would also be very useful when using subplots. The upper limit can be the same in axis so we could compare more easily. |
+1. I am using extendPlots on a larger data set in which I only want to show up to the last two days (xaxis) and using extendTraces. I do not want to limit the points as extendTraces can (it doesn't know dates and it drops points completely). If range took null for one side I can envision extendTraces auto scrolling the xaxis as points are added always leaving the new points showing. |
I need this feature too! Sometimes I have only zero values and auto axis sets up to -1 to 1, but negative values are impossible for my data. |
Have you tried setting |
@etpinard Thanks. It's working |
Has anyone found another solution to this? I am using custom controls with the update button on a chart, so the y axis scale changes every time a user clicks a different control. Plotly's default maximum value for each of them is fine but I'd like the minimum to be lower so the plot is easier to see. I tried setting axes in the layout and assigning them to each trace, but instead of the axes swapping out when a user clicks the buttons, they just all show up at once on top of one another.
|
Is there any updated way to achieve axis starting at 0? |
@phoenixlike #400 (comment) |
+1 on adding this. Thanks! |
Is there any intention to do this. I am trying to build a Dash app where user can enter a Minimum or a Maximum. It causes an issue because I have to have a default min and max or the function won't run. So far I have set defaults to be the greatest (or lowest) value in a data set plus (minus) a small value however this doesn't work for all charts (like bar charts). |
Has there been any progress on this? |
@ravitshrivastav: this is stale, but as @etpinard pointed out, This covers the main use case for me. |
Found the solution for setting the x or y axis's minimum value to zero. Add the following to the |
Thanks @dylanhenson! That's great. (I think you mean |
Sorry about that, I was writing this code in R, I just realized this thread is all javascript. Hopefully |
I would like to set a min range for axis. In order that the axis at least shows a range of the given value, also with enabled autorange (axis is shifting foreward, if new datapointa are inserted, but has a fixed range in the beginning). |
Is there a way to restrict the y-axis to only negative values? I tried 'rangemode':'nonpositive' and 'rangemode':'negative' but these don't seem to work. |
@aanchalvazir can you provide a codepen or jsfiddle reproducing the issue you're seeing with |
Sounds like @aanchalvazir is asking for the opposite of |
@nicolaskruchten Yes, correct. I don't mean to report a bug. I meant to ask if there is a similar approach for ONLY NEGATIVE values for y-axis in Plotly. I am unable to find a solution to that. On the contrary, a work around could be to fix the 'range' property for y-axis to something like : [-100,0] but what about cases where the lower limit (-100 in this case) is unknown? |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
Same request to set axes separately from python backend Proposal is to allow pass None if value should be automatically determined: |
Hi is there any updates? |
I found a way to set one side of the y axis by adding a transparent horizontal line. For example,
Hope this helps! |
Dear all
Many thanks for all your wonderful efforts with Plotly
I just wanted to ask if it might be possible to tweak the range function a little
currently an axis range can be set in the layout like this ...
in some cases it would be desirable to only specify a min value.
Plotly can then work out the max value automatically.
Or perhaps a user would want to set a max value and have a plotly work out the min value
Either-way it would be nice (for me at least) to only specify one of the range limits and not both. However I can see why this might not be a highly required function and I'm sure there are lots of other things to do first
matplotlib offers this function ...
The text was updated successfully, but these errors were encountered: