first tick label on categorical x-axis misplaced when labels are rotated
See original GitHub issueVersions
hvplot 0.8.1
holoviews 1.15.1
pandas 1.5.0
python 3.9.13
jupyterlab 3.4.5
Chrome Browser
Description
The first tick label on a categorical x-axis is not correctly placed horizontally when tick labels are rotated at an angle (not 0 or 90 degrees). It is much closer to the second tick label than it should be. I noticed that while working with a larger set of labels. This can also be easily seen with a smaller set of labels by making the plot very narrow. I have tested bar
, area
, line
, and scatter
. They all have that issue.
Example
import hvplot.pandas
import pandas as pd
df = pd.DataFrame([["Steven Spielberg", 5],
["Alfred Hitchcock", 4],
["Stanley Kubrick", 4],
["Billy Wilder", 4],
["John Huston", 3]],
columns=['Director', 'Frequency'])
df.hvplot.bar(rot=45, x='Director', y='Frequency', width=150)
Stack traceback
No error message.
Screenshots
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Bokeh plot - custom categorical tick labels - Stack Overflow
I am able to use a LinearAxis to place the ticks in the location that I want, which is the first date of...
Read more >Rotate Tick Labels in Matplotlib - Stack Abuse
In this tutorial, we'll take a look at how to rotate tick text/labels in a Matplotlib plot. Creating a Plot. Let's create a...
Read more >Rotating axis labels in matplotlib and seaborn
Here we have the classic problem with categorical data: we need to display all the labels and because some of them are quite...
Read more >Rotate x-axis tick labels - MATLAB xtickangle - MathWorks
Plot into each of the axes. Then rotate the x-axis tick labels for the lower plot by specifying ax2 as the first input...
Read more >Fixing too many ticks — Matplotlib 3.6.2 documentation
Matplotlib treats lists of strings as categorical variables (Plotting categorical variables), and by default puts one tick per category, and plots them in ......
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
The Bokeh issue suggests it’s fixed in bokeh 3.0, which is imminent, though it may be some time before holoviz tools support the big changes that 3.0 brings.
Ah, the ever-ambiguous “this” was fixed. 😕