charts

How to change the labels of an area chart on Streamlit?

How to change the labels of an area chart on Streamlit? Question: I have deployed an area chart using Streamlit for Python. Is it possible to change the labels for the axis X, as well as the labels for each data point plotted? import streamlit as st import pandas as pd st.write(""" My area chart …

Total answers: 2

How to increase planes' size in Plotly

How to increase planes' size in Plotly Question: Got the following code import pandas as pd import plotly.graph_objects as go import numpy as np df = pd.read_csv(‘https://raw.githubusercontent.com/tiago-peres/immersion/master/Platforms_dataset.csv’) fig = px.scatter_3d(df, x=’Functionality ‘, y=’Accessibility’, z=’Immersion’, color=’Platforms’) grey = [[0,’#C0C0C0′],[1,’#C0C0C0′]] zero_pt = pd.Series([0]) z = zero_pt.append(df[‘Immersion’], ignore_index = True).reset_index(drop = True) y = zero_pt.append(df[‘Accessibility’], ignore_index = True).reset_index(drop …

Total answers: 1

Using multiple font sizes in Plotly chart title (Python)

Using multiple font sizes in Plotly chart title (Python) Question: I have a chart title which spans multiple lines using line breaks. I’d like to have everything after the first line in a smaller font (effectively a subtitle), but can’t figure out a way to do this. Couldn’t see any similar question on here. import …

Total answers: 2

Python – Legend overlaps with the pie chart

Python – Legend overlaps with the pie chart Question: Using matplotlib in python. The legend overlaps with my pie chart. Tried various options for “loc” such as “best” ,1,2,3… but to no avail. Any Suggestions as to how to either exactly mention the legend position (such as giving padding from the pie chart boundaries) or …

Total answers: 1

Using plotly without online plotly account

Using plotly without online plotly account Question: Is it possible to use the plotly library to create charts in python without having an online plotly account? I think the code is opensource https://github.com/plotly/plotly.py. I would like to know whether we can use this without an online account. Asked By: Harnish || Source Answers: Yes, it …

Total answers: 4

Python matplotlib.pyplot pie charts: How to remove the label on the left side?

Python matplotlib.pyplot pie charts: How to remove the label on the left side? Question: I plot a piechart using pyplot. import pylab import pandas as pd test = pd.Series([‘male’, ‘male’, ‘male’, ‘male’, ‘female’], name=”Sex”) test = test.astype(“category”) groups = test.groupby([test]).agg(len) groups.plot(kind=’pie’, shadow=True) pylab.show() The result: However, I’m unable to remove the label on the left …

Total answers: 3

How to create a matplotlib bar chart with a threshold line?

How to create a matplotlib bar chart with a threshold line? Question: I’d like to know how to create a matplotlib bar chart with a threshold line, the part of bars above threshold line should have red color, and the parts below the threshold line should be green. Please provide me a simple example, I …

Total answers: 2

Python Matplotlib: how to create a pie chart with variable values

Python Matplotlib: how to create a pie chart with variable values Question: I currently have a working program that creates pie charts similar to the similar code below: import matplotlib.pyplot as plt def get_name_counts(Names): if “Bob” in Names: NameList[0] +=1 elif “Ann” in Names: NameList[1] +=1 elif “Ron” in Names: NameList[2] +=1 elif “Zee” in …

Total answers: 1

Plot Pandas DataFrame as Bar and Line on the same one chart

Plot Pandas DataFrame as Bar and Line on the same one chart Question: I am trying to plot a chart with the 1st and 2nd columns of data as bars and then a line overlay for the 3rd column of data. I have tried the following code but this creates 2 separate charts but I …

Total answers: 2