#๐Ÿ”’ Plotly not showing histogram

6 messages ยท Page 1 of 1 (latest)

warped grove
#

Hi, I'm trying to create an interactive histogram with plotly, but fig.show() does not open up my visualization.
I have the following plotly version installed: '5.19.0'

**Python version: **Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)] on win32
IDE: Pycharm Community.
System: Laptop with Windows 11 Education, 64 bit, Version 23H2, OS build 22631.3447

I'm trying to run the **following code **(both in python console and in a script) but no figure shows (and I get no error message):

import plotly.graph_objects as go
import numpy as np
np.random.seed(1)
x = np.random.randn(500)
fig = go.Figure(data=[go.Histogram(x=x)])
fig.show()

I tried installing plotly in another conda env and it displayed the histogram just fine.
This env has the following packages: https://pastebin.com/eSjYw5p2
The env I want to use plotly on has the following packages installed: https://pastebin.com/3M07ULae
Also, the TensorFlow 2.10 runs just fine with my RTX 3050 Ti GPU without requiring WSL.

Any ideas on how I could fix this on my Py3.10 TF 2.10 env?

junior robinBOT
#

Hey @warped grove!

It looks like you incorrectly specified a language for your code block.

Make sure you put your code on a new line following py. There must not be any spaces after py.

Here is an example of how it should look:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
junior robinBOT
#

@warped grove

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

warped grove
#

solved with fig.show(renderer='browser')

junior robinBOT
#

@warped grove

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.