1

I am new to plotly and wanted to visualize some data. I got this plot. see here But I want to get this in 2 or more column based so that it can be seen better. Can someone help me with that. Here is my source code what I have tried:

import pandas as pd
import plotly.express as px

fig = px.scatter(data2, x = "Total_System_Cost", y= "Total_CO2_Emissions",
                        color="Pol_Inst", symbol="Pol_Inst",
                        facet_row='Technologie',width=600, height=3500)
fig.show()

And the data looks like this.here

1
  • 1
    Hi @shakhawat, and welcome to SO. Please have a look at mcve and how-to-ask. In particular share code or data as text not pictures so it will be easier for other users to help you. Commented Jul 8, 2020 at 23:21

1 Answer 1

1

In this case you should use facet_col and facet_col_wrap as in this example

import pandas as pd
import plotly.express as px

fig = px.scatter(data2, 
                 x="Total_System_Cost",
                 y="Total_CO2_Emissions",
                 color="Pol_Inst",
                 symbol="Pol_Inst",
                 facet_col='Technologie',
                 facet_col_wrap=2, #eventually change this
)

fig.show()

If you then want to use width and height do it so according to data2['Technologie'].nunique() and the value you picked for facet_col_wrap.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.