0

I have the plotly code as below with dataframes. I'm unable to create an image with the below code. I see the same working in other system. what could be the issue ??

SampleData: df3

,ts,windSpeed,windDirection,tsDate,tsYear,tsMonth,tsDay,tsHour,powerGenKW,powerPerc,powerPercSq,dtCnt,iAmp,iPerUnit,iPerUnitSq,tInf
87955,2013-06-16 19:00:00,0.075,263.5,2013-06-16,2013,6,16,19,0.0,0.0,0.0,3665,0.0,0.0,0.0,0.6303445045509951
87200,2013-05-16 08:00:00,0.153,74.0,2013-05-16,2013,5,16,8,0.0,0.0,0.0,3634,0.0,0.0,0.0,0.6303445045509951
81201,2012-09-08 09:00:00,0.212,21.2,2012-09-08,2012,9,8,9,0.0,0.0,0.0,3384,0.0,0.0,0.0,0.6303445045509951
65785,2010-12-06 01:00:00,0.242,345.0,2010-12-06,2010,12,6,1,0.0,0.0,0.0,2742,0.0,0.0,0.0,0.6303445045509951

import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
    
df4_fig = get_output1(df3)
fig1 = px.scatter(df4_fig, x="day", y="p_ma")
fig2 = px.line(df4_fig, x="day", y="p_ma")
fig3 = go.Figure(data=fig1.data + fig2.data)
subfig = make_subplots()
subfig.add_traces(fig3.data)
subfig.update_layout(autosize=False, width=1000, height=600, xaxis=dict(tick0=0, dtick=10),
                     title="Maximum Load in % as a function of period T based on 16 years data",
                     xaxis_title="Length of moving average (Days)", yaxis_title="Max windfarm load (%)")
subfig.write_image(os.path.join(output_filepath, 'Output1.png'), engine='kaleido')
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
max
  • 7
  • 4
  • Please produce a minimum reproducible code to recreate the issue with sample data. – Roxy Oct 06 '21 at 21:37
  • Since there is no data presented, I used this example from the [official reference](https://plotly.com/python/mixed-subplots/#mixed-subplot) and was able to save it without any problems. My environment is plotly:5.2.2,kaleido:0.2.1. Are all systems the same version of kaleido? – r-beginners Oct 07 '21 at 01:21
  • Sample Data (df) updated. In every system we are installing through requirements. for plotly:5.3.1, kaleido:0.2.1 versions. – max Oct 07 '21 at 04:28
  • In this link, i see it varies with different systems. Is it the same ? https://stackoverflow.com/questions/69016568/unable-to-export-plotly-images-to-png – max Oct 07 '21 at 04:30

0 Answers0