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.

Histogram in 3.4.0

See original GitHub issue

Hi, I think there is an issue with FigureWidget in 3.4.0. The behavior I will describe below did not exist in 3.3.0.

I use Jupyter Lab.

import numpy as np

import plotly.graph_objs as go
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
# Simulations
n = 100
A = np.arange(1,n+1, dtype=float).reshape(n,1)**(-2)
X = 2*np.random.randint(2, size=(n,1000000))-1

Now, this works: iplot([go.Histogram(x=np.sum(A*X,axis=0))])

newplot

This does not work (even though it did before):

# Histogram for S_n
fig = go.FigureWidget()
fig.add_histogram(x=np.sum(A*X,axis=0),
                  opacity=0.75,
                  histnorm='probability density')
fig['layout'].update(title='Distribution of $S_{'+str(n)+'}$', 
                  showlegend=False, height=700)
fig

newplot 1

Also, note that part of the title is not displayed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sursucommented, Nov 7, 2018

@jonmmease Yes. Issue fixed.

Thank you! 👍

1reaction
jonmmeasecommented, Nov 3, 2018

Hi @sursu, yes the fix will preserve FigureWidget’s efficiency 🙂

As for the situation with your title, at this point LaTeX can’t be mixed with non-latex. So the $signs need to be the first and last characters of your string. In this case you could set your title string to something like '$\\text{Distribution of }S_{10}$' to get what you want. Or, if all you need is italic text and subscripts you could do this in HTML as 'Distribution of <i>S</i><sub>10</sub>'

Read more comments on GitHub >

github_iconTop Results From Across the Web

Histogram — MapD 3.4.0 documentation - docs
The Histogram displays the distribution of data across a continuous (typically time-based) variable, by aggregating the data into bins of a fixed size....
Read more >
3.4 Histograms (STATISTICS AND MECHANICS 1 - Chapter 3
hindsmathsHow to draw histograms and work out frequencies from histograms0:00 Intro0:50 Example 55:01 Example 68:17 End/Recap.
Read more >
matplotlib.pyplot.hist — Matplotlib 3.4.0 documentation
'bar' is a traditional bar-type histogram. If multiple data are given the bars are arranged side by side. 'barstacked' is a bar-type histogram ......
Read more >
4 : Histogram Backprojection - OpenCV
The object should fill the image as far as possible for better results. And a color histogram is preferred over grayscale histogram, because...
Read more >
Histograms - R
The generic function hist computes a histogram of the given data values. If plot = TRUE , the resulting object of class "histogram"...
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