Histogram in 3.4.0
See original GitHub issueHi, 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))])
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
Also, note that part of the title is not displayed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top 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 >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
@jonmmease Yes. Issue fixed.
Thank you! 👍
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>'