All Questions
Tagged with plotly-python or plotly
17,936 questions
0
votes
0
answers
9
views
ggplotly first bar label half hidden in horizontal bar chart
I cannot understand why my ggplot first bar label is half hidden in the horizontal bar chart below.
I don't want to reduce the size of the labels because they would look too small. I tried adding a ...
0
votes
0
answers
16
views
Clickable link (hyperref) in a plotly table without the use of dash
Is there a way to create a clickable link in a plotly table without using dash?
The following code shows the links but they are not clickable.
import plotly.graph_objects as go
import pandas as pd
...
0
votes
0
answers
14
views
How to use a local GeoJSON file (world_110m.json) with Plotly in PySide6 to prevent external fetching?
I’m trying to display a choropleth map using Plotly and PySide6. I want to ensure that all resources, including world_110m.json, are loaded locally and not fetched from the CDN. I already have a ...
0
votes
1
answer
36
views
Trying to load plotly-latest.min.js locally for Pyside6 WebEngine
I am building a PySide6 GUI application that uses Plotly for interactive visualizations. Initially, I used the Plotly CDN to load the plotly-latest.min.js script in my HTML, and everything works fine. ...
1
vote
1
answer
17
views
Create a stacked bar chart in Plotly where each stack is ordered with the largest bar at the bottom of each stack
I'm plotting the following chart, but I would like to sort each stack separately so that the largest bar is at the bottom of each stack and smallest at the top.
Unsorted stacked bar chart
I used the ...
0
votes
0
answers
21
views
How to save R interactive plots (e.g. plotly plots) in Linux? [duplicate]
I have created an interactive plot using plotly (with tooltips). I am using Linux command line interface.
Is it mandatory to use RStudio to save these interactive plots as they are (not as static ...
0
votes
0
answers
20
views
Re-override plotly-resampler reset axis behavior
I created a Dash app that displays a figure in it. I have used plotly-resampler since I had to deal with large datasets.
At the documentation of plotly-resampler, they mentioned this:
The plotly ...
0
votes
0
answers
26
views
How to show plotly plot in `blastula` rmd file
i tried to embed plotly plot in rmd file. When I knit this in RStudio plot shows but in mail send via blastula package it disapears.
My code
title: "test_pliku_rmd"
output: blastula::...
1
vote
1
answer
20
views
Plotly indicator plot for specific values
Code bellow gives me plot for value 20 from 30.
How can I change max of this plot (in my example 30)?
library(plotly)
fig <- plot_ly(
domain = list(x = c(0, 1), y = c(0, 1)),
value = 20,
...
1
vote
1
answer
33
views
How to change text color of facet category in plotly charts in Python?
I have created few Plotly charts with facets on basis of category variable and would like to change the color of facet text in the chart. Have searched alot even on plotly website but couldn't figure ...
0
votes
1
answer
33
views
Plotly Choropleth Map: Colors Not Mapping Correctly from Color Dictionary
I am trying to create a choropleth map using Plotly with a custom color dictionary, where specific states should be colored red and green. However, when trying to apply these colors, the chart is ...
1
vote
1
answer
22
views
Log axis in ploy_ly for R
I'm trying to make a 3D mesh plot with log x and y axis using plot_ly.
library(plotly)
help_plot_data <- data.frame(A_Conc = rep(c(1:100), times = 100),
B_Conc = rep(c(...
2
votes
1
answer
77
views
How can I use x0/dx in Plotly for a date-based x axis?
I happen to be using Plotly.js, but I suspect this is generic to Plotly across all platforms.
I'm trying to plot a scatter plot of voting intentions, with trend lines over time. There are relatively ...
0
votes
1
answer
30
views
Plotly KDE in histogram
I can create a histogram in Plotly like this:
import plotly.figure_factory as ff
import plotly.express as px
data = px.data.tips()["tip"]
ff.create_distplot([data], group_labels=["Tip&...
2
votes
0
answers
23
views
How to fix overlaying x axis in a plotly.js subplots?
I was trying to create a plot using plotly.js which have 2 subplots arranged in a grid with 8 tracks, 4 in each subplot. All track has separate y axis and shared x axis except one track which also ...
0
votes
1
answer
87
views
Trying to install version 0.1.0.post1 but not available on Azure App Service
I am using kaleido==0.1.0.post1 (which works on local) in my python plotly dash web app and deploying this on Azure App Service with the configuration of the app service as:
python: 3.12.6
pip: 24.2
...
2
votes
1
answer
34
views
geom_xspline not implemented in plotly - getting error message when using ggplotly() function (R)
I get an error message when trying to implement geom_xspline with
plotly in R.
I get the desired graph in ggplot2 but the plot cannot be converted to a
plotly object when using the ggplotly function.
...
0
votes
0
answers
20
views
Plotly-Resampler Not Resampling on Zoom Events in Flask-React Integration
I am experiencing an issue with the plotly-resampler in my Flask backend, which does not resample data as expected when zoom events are triggered in the React frontend. Despite adding an API endpoint ...
2
votes
1
answer
66
views
How to conditionally fill between two line charts with different colours using Plotly in Streamlit?
I'm trying to fill with colour the space between two line charts (between col1 and col2) as follows:
Desired output:
when col1 is above col2, fill with color green.
if col1 is under col2, fill with ...
0
votes
0
answers
34
views
How to capture clicked legends in Plotly?
I created a radar chart that displays data called zones. I am not able to make a callback function that returns the legends visible currently by user's action on the legend. When user deselects legend ...
0
votes
0
answers
21
views
Stack 2d heatmaps on top of each to create 3d tomography plot in python [duplicate]
I am trying to understand how to create 3D tomography plots in python. I have created a list of correlation matrices, and I want to plot each correlation matrix as a 2d heatmap, where the color ...
1
vote
1
answer
23
views
How to correctly mask section of a cylindrical surface in Plotly 3D surface plot?
I’m trying to plot a 3D cylindrical pipe using Plotly in Python, and I want to exclude a section of the pipe based on angle. I’m using np.nan to mask the values in the array, but I’m facing issues ...
1
vote
0
answers
30
views
Finding Mean of Y_Var user input in Shiny using Plotly
I am hitting a roadblock in trying to find the mean value of the Y Axis of user input in plotly. I am making a shiny app and I need to be able to allow users to select different combinations of ...
2
votes
1
answer
55
views
Incorrect z-values in plotly
I want to plot a surface $f(x,y) = x^2+2x-y$ and its tangent plane at point $(0,3,-3)$ but the code does not give the correct plot.
library(plotly)
x <- seq(from = -3, to = 3, length.out = 100)
y &...
0
votes
1
answer
46
views
How to adjust text labels and color gradient in ggplotly stacked bar-chart?
When I convert my ggplot stacked bar chart to ggplotly, there are two issues that I can't solve:
the text labels at the end of the bars change position unexpectedly. I would like them to keep their ...
1
vote
1
answer
63
views
no kaleido source distribution or wheel for uv on current platform
kaleido does not seem to work currently in a uv venv.
is there a workaround?
tried to output plotly static figs to .jpg
this depends on kaleido
Example:
f = px.scatter(
x=[1,2,3],
y=[4,5,6]
)
...
1
vote
1
answer
40
views
Plotly add_image vs add_layout_image
In Plotly, both figure.add_image and figure.add_layout_image allow you to add an image to a chart. It seems like add_layout_image is intended for "cosmetic" images that shouldn't belong to a ...
0
votes
0
answers
19
views
ggplot2 error: 'object 'days_after_grounding' not found' when building plot, despite column existing in dataset [duplicate]
Apologies for any mistakes, I'm new to R. I'm trying to create an animated plot using ggplot2 and plotly in R, but I'm encountering an error that I can't resolve. Here's my code:
ggplot(...
0
votes
0
answers
15
views
Redundant Y-axis on plotly Box chart where color attribute is set
I tried to differentiate a single point in a "beeswarm" chart to see its location in a distribution. But setting color and color_discrete_map spreads out the dots; they seem to follow some ...
0
votes
0
answers
39
views
Why is the line border colour of a portion of a Plotly Go pie slice two seperate colours?
I am trying to create a pie chart using Plotly.Go and place it into a Streamlit app. My pie chart is basically complete, and just requires a border colour around each differing slice. I was able to ...
1
vote
2
answers
24
views
Insert image with border in Plotly
To create a plotly scatter plot with images at each point, we can do:
import plotly.express as px
from PIL import Image
xs = [0, 1, 2]
ys = [0, 1, 4]
images = [Image.open("a.png"), Image....
0
votes
0
answers
21
views
missing xaxis ticks with plotly
I have a pandas dataframe with hourly data shown in 7 subplots for a weeks data.
fig = make_subplots(
rows=7,
cols=1,
subplot_titles=subPlotNames,
shared_xaxes=True,
shared_yaxes='...
1
vote
1
answer
25
views
PlotlyJS 'scatter3D' not working outside ng serve
I basically have two Plotly-charts, one 'scattergl' and one 'scatter3d'.
If I am using ng serve everything works fine and both charts are shown perfectly. The trouble begins if I use ng build and ...
0
votes
1
answer
68
views
Problem in ggplot2 with color and shape variables combining into a concatenated legend [closed]
So I have a plot which I'm trying to have the points colored by type1 and the shape shaped by note1 etc. For some reason, the plot is concatenating the dang things into a key like this:
type1
note1
- -...
0
votes
1
answer
31
views
Plotly express issue: box plosts shifted on the x axes when facetting
I am experiencing an unexpected behavior with plotly express when trying to plot a number of groups as facet box plot
import pandas as pd
import numpy as np
# Generate random data
np.random.seed(0) #...
-1
votes
0
answers
42
views
How do I make the bars visible in a plotly bar chart animation?
I'm trying to make a bar chart animation that slowly shows each bar, but I can't make it work as intended. When I run the code, the bar appears extremelly thin and then disappears to show the next ...
0
votes
0
answers
16
views
Issue with downloading react application component with html2pdf
I am facing an issue while using html2pdf with react application component which is crashing whenever save button for html2pdf function is called.
I have tried react-to-pdf and html2pdf.js both of ...
1
vote
0
answers
23
views
Plotly.js component not re-rendering in React when state changes
I'm using react-plotly.js to render a plot in my React application. I have a Zustand store to manage the state of my plot data and layout. When I click a button to fetch new data and update the state, ...
1
vote
2
answers
64
views
How to plot 4D graphs using plotly?
I'm trying to figure out a way to plot my 4D data using plotly, and it looks crazy to me that there are no references online for this.
What I'm trying to achieve is a simple interface with 3 drop-down ...
0
votes
0
answers
20
views
Rendering error with Plotly and Jupyterlab
I started getting the following error ("started" as in "it appeared without me changing any package or other setup aspect"):
File ~/venv/telematics_py311/lib/python3.11/site-...
0
votes
1
answer
18
views
Two stacked area plots on the same chart
Plotting assets
I'm plotting $MSTR assets as follows
fig = px.area(df_all, x='end', y='val', color='fact', title=f'{symbol.upper()} : Balance sheet', width=1000, height=600)
fig.add_trace(go.Scatter(...
0
votes
1
answer
24
views
Plotly: Increasing figure size to make room for long footnote
Building on the example in this thread, I have the following code:
import plotly.express as px
import plotly.graph_objects as go
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent....
1
vote
0
answers
35
views
Plotly Limited WebGL instances when using subplots
I'm trying to produce a figure using Python and plotly, it's meant to consist of a considerably large number (>=25) of subplots, each of which is a 3D surface plot.
I am running into issues with my ...
3
votes
1
answer
57
views
Remove unused node in python plotly
What im trying here is to create a relationship between Tasks. Some of them are connected directly to each other while others are passing through this big box i circled instead of connecting directly(...
0
votes
1
answer
283
views
Kaleido RuntimeError
I create a virtual environment using
python3 -m venv venv
Activate
source venv/bin/activate
Install Plotly package
pip install plotly
Try to run the following script dft.py
#!./venv/bin/python3
...
0
votes
0
answers
26
views
How do I visualize/render 3D poliastro plots in vscode?
I am learning the poliastro code library and using VSCode. I am still considered new to Python. I am having trouble following the tutorial for 3D plotting in poliastro. Whenever I try to visualize the ...
1
vote
2
answers
36
views
Plotting Intersecting Planes in 3D Space Plotly
I'm trying to plot 3 planes in 3D space using plotly, I can only define a surface along the XY plane, whilst ZY and XZ do not appear.
I'm including a simple example below, I would expect the code to ...
0
votes
0
answers
26
views
How to plot multiple Y axis in data vizualization in R Plotly
I am trying to write a code which will plot multiple variables on a graph when the variables are clicked. The language is R and I am using Shiny to create an app. The following one is a sample.
...
0
votes
1
answer
43
views
Autoplot(ly): how can labels appear when hovering over points
I am trying to figure out how to label the points in a graph such that the label appears only when hovering over the point but not otherwise.
Consider the following reproducible example:
library(...
1
vote
1
answer
29
views
A sunburst plot produced by R's plot_ly function shows a blank page
There is no way to produce a sunburst plot in R with this data using the plot_ly function from the plotly package.
library(plotly)
df <- data.frame(
Valutazione = c('1 stella', '2 stelle', '3 ...