Repository: dask/distributed

Issue:
Rotate text of Bandwidth type chart

![image](https://user-images.githubusercontent.com/306380/88599638-19964c80-d021-11ea-808e-9d3a3e9d8e50.png)

We should probably slightly rotate the labels on the x axis so that they pack a bit more nicely.

This requires understanding a bit of Bokeh (or looking at their docs) and modifying the BandwidthTypes class here

https://github.com/dask/distributed/blob/907452b1bc0f7876a01de5ff39cc2dc64eb3c4a4/distributed/dashboard/components/scheduler.py#L274-L322


Discussion:
We do this for other plots too, so there are probably examples of rotating text in that same file
`fig.xaxis.major_label_orientation = -math.pi / 12` is what we've typically done
I'll happily take a stab at this, probably next week some time!
@hugobowne Did you start working on this issue ? Otherwise, I would be glad to work on it.
Go for it Mathieu

On Sat, Aug 8, 2020, 4:20 PM Mathieu Dugré <notifications@github.com> wrote:

> @hugobowne <https://github.com/hugobowne> Did you start working on this
> issue ? Otherwise, I would be glad to work on it.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/dask/distributed/issues/3992#issuecomment-670984185>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACKZTAATZQYLFE75LHCJE3R7XMT3ANCNFSM4PJRXKGQ>
> .
>

Following @quasiben suggestion I set the `fig.xaxis.major_label_orientation` to rotate the x-axis labels. After trying different values, I found that a rotation of `-0.5` looked pretty good.
Those are the plots generated with a value of `-0.5`: 

### Dask Bandwidth [Type]
![image](https://user-images.githubusercontent.com/16450132/89724992-c8f7f980-d9f9-11ea-9655-584b094bcb03.png)

### Dask Bandwidth [Type] (smaller window)
![image](https://user-images.githubusercontent.com/16450132/89724994-d0b79e00-d9f9-11ea-9f9c-ce774dd944a2.png)

If this seems good, I'll open a PR. 

It seems like an improvement to me :)

On Sat, Aug 8, 2020 at 9:41 PM Mathieu Dugré <notifications@github.com>
wrote:

> Following @quasiben <https://github.com/quasiben> suggestion I set the
> fig.xaxis.major_label_orientation to rotate the x-axis labels. After
> trying different values, I found that a rotation of -0.5 looked pretty
> good.
> Those are the plots generated with a value of -0.5:
> Dask Bandwidth [Type]
>
> [image: image]
> <https://user-images.githubusercontent.com/16450132/89724992-c8f7f980-d9f9-11ea-9655-584b094bcb03.png>
> Dask Bandwidth [Type] (smaller window)
>
> [image: image]
> <https://user-images.githubusercontent.com/16450132/89724994-d0b79e00-d9f9-11ea-9f9c-ce774dd944a2.png>
>
> If this seems good, I'll open a PR.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/dask/distributed/issues/3992#issuecomment-671005574>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACKZTC3IKPNIEC5H7CZRODR7YSIHANCNFSM4PJRXKGQ>
> .
>


Resolving patch:
diff --git a/distributed/dashboard/components/scheduler.py b/distributed/dashboard/components/scheduler.py
--- a/distributed/dashboard/components/scheduler.py
+++ b/distributed/dashboard/components/scheduler.py
@@ -297,6 +297,7 @@ def __init__(self, scheduler, **kwargs):
                 y_range=["a", "b"],
                 **kwargs,
             )
+            fig.xaxis.major_label_orientation = -0.5
             rect = fig.rect(
                 source=self.source,
                 x="bandwidth-half",


Test patch: