Setting only min or max values for axis and not a range.
See original GitHub issueDear 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 …
layout = go.Layout(
xaxis=dict(
range=[2, 5]
),
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 …
plt.xlim(2,5) #sets a range
plt.gca().set_xlim(xmin=2) # sets only the lower x value and allows computer to work out upper value
plt.gca().set_ylim(ymax=50) # sets only the lower y value and allows computer to work out upper value
Issue Analytics
- State:
- Created 7 years ago
- Reactions:85
- Comments:26 (6 by maintainers)
Top Results From Across the Web
Change the scale of the vertical (value) axis in a chart
In the Format Axis dialog box, click Scale, and under Value axis scale, modify any of the following options: To change the number...
Read more >Show only min and max values on x-axis in column chart
Right click the chart and choose Select Data. In the x-axis label range, choose C1:10. Because you only have values on the first...
Read more >How to set max and min value for Y axis - chart.js
As you can see max value (130) and min value (60) for Y axis are chosen automatically , I want max value =...
Read more >How to set chart axis based on a cell value - Excel Off The Grid
The chart axis min and max settings are fixed values. This posts looks at a automated method to set chart axis based on...
Read more >Setting X axis min and max values outside of data range
I have a query which returns a DataTable with two columns, a Date and a Value. It only returns a row if there's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found the solution for setting the x or y axis’s minimum value to zero. Add the following to the
layout()
object:yaxis = list(rangemode = 'tozero')
orxaxis = list(rangemode = 'tozero')
Same request to set axes separately from python backend
https://github.com/plotly/plotly.py/issues/3634
Proposal is to allow pass None if value should be automatically determined: range=[2, None]