question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

first tick label on categorical x-axis misplaced when labels are rotated

See original GitHub issue

Versions

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

Screen Shot 2022-10-09 at 1 21 28 AM

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jbednarcommented, Oct 11, 2022

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.

1reaction
jbednarcommented, Oct 11, 2022

Ah, the ever-ambiguous “this” was fixed. 😕

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found