Skip to content

Commit 83f4c04

Browse files
docs for ticklabelposition
1 parent 62f1c4d commit 83f4c04

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Diff for: doc/python/axes.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fig = px.bar(df, x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
124124
fig.show()
125125
```
126126

127-
##### Rotate axes in Dash
127+
##### Rotating tick labels in Dash
128128

129129
[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.
130130

@@ -137,6 +137,19 @@ snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'
137137
IFrame(snippet_url + 'axes', width='100%', height=630)
138138
```
139139

140+
#### Moving Tick Labels Inside the Plot
141+
142+
The `ticklabelposition` attribute moves tick labels inside the plotting area, and modifies the auto-range behaviour to accomodate the labels.
143+
144+
```python
145+
import plotly.express as px
146+
147+
df = px.data.stocks(indexed=True)-1
148+
fig = px.bar(df, x=df.index, y="GOOG")
149+
fig.update_yaxes(ticklabelposition="inside top", title=None)
150+
fig.show()
151+
```
152+
140153
##### Set axis title text with Graph Objects
141154

142155
Axis titles are set using the nested `title.text` property of the x or y axis. Here is an example of creating a new figure and using `update_xaxes` and `update_yaxes`, with magic underscore notation, to set the axis titles.

Diff for: doc/python/time-series.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.2'
9-
jupytext_version: 1.6.0
9+
jupytext_version: 1.4.2
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.6
23+
version: 3.7.7
2424
plotly:
2525
description: How to plot date and time in python.
2626
display_as: financial

0 commit comments

Comments
 (0)