Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Plotly set axes labels

import plotly.express as px

df = px.data.iris()
fig = px.scatter(df, x="sepal_length", y="sepal_width", color="species",
                 labels={
                     "sepal_length": "Sepal Length (cm)",
                     "sepal_width": "Sepal Width (cm)",
                     "species": "Species of Iris"
                 },
                title="Manually Specified Labels")
fig.show()
Comment

plotly go axis labels

import plotly.graph_objects as go

fig = go.Figure(go.Scatter(
    y = [4, 1, 3],
    x = ["December", "January", "February"]))

# set x axis label
fig.update_xaxes( 
        title_text = "Month", # label
        title_font = {"size": 20},
        title_standoff = 25)

# set y axis label
fig.update_yaxes(
        title_text = "Temperature", # label
        title_standoff = 25)

fig.show()
Comment

PREVIOUS NEXT
Code Example
Python :: change the frequency to column in pandas 
Python :: how to check libraries in python 
Python :: find character in python 
Python :: script python to download videio from any website 
Python :: dataframe plot histogram 
Python :: get root path python 
Python :: fast fourier transform python 
Python :: zscore python 
Python :: how to import sin and cos in python 
Python :: making lists with loops in one line python 
Python :: pyauto gui save screenshot 
Python :: Chi-Squared test in python 
Python :: search dictionary for value 
Python :: pandas drop row from a list of vlaue 
Python :: pandas sep 
Python :: multiple pdf in a directory to csv python 
Python :: convert text to speech in python 
Python :: python logger to different file 
Python :: python check if array is subset of another 
Python :: create django group 
Python :: discord.py get channel id by channel name 
Python :: how to make an infinite loop python 
Python :: how to play mp3 files using vlc python library 
Python :: pyqt5 keypressevent 
Python :: count elements in list 
Python :: change value in excel using python 
Python :: pandas data profiling 
Python :: how to send file using socket in python 
Python :: selenium get cookies python 
Python :: python check if key exists 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =