Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
How to remove the axes tick marks in plots from plotly?

Scatterplot using plotly How do I format this better? I create unordered pairs from list of columns and plotting them iteratively. I havent managed to remove the axis tick labels. Any suggestions on howto format this better so that I display it in front end?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I suppose you are using plt.subplots(x, y) here. To remove axes (including there text) completely, you can use subplot[x, y].axis('off').
Alternatively, you could add more space in between the plots with plt.margins(x_y_margin) or plt.margins(x_margin, y_margin).

A little bit offtopic: I wouldn't use scatter plots for visualization of classes (like in the plot 2nd row 3rd column).

about 4 years ago · Juan Pablo Isaza Report

0

  • you have not indicated how you are building the sub-plots
  • you can make all axis invisible with fig.update_layout({ax:{"visible":False, "matches":None} for ax in fig.to_dict()["layout"] if "axis" in ax})
  • full example code:
import numpy as np
import pandas as pd
import plotly.express as px

L = 100
df = pd.DataFrame(
    {
        "lin": np.linspace(0, 100, L),
        "cos": np.cos(np.linspace(0, np.pi, L)),
        "sin": np.sin(np.linspace(0, np.pi, L)),
        "tan": np.tan(np.linspace(0, np.pi, L)),
        "char": np.random.choice(list("ABCDEF"), L),
        "rand": np.random.uniform(1,50, L)
    }
)

fig = px.scatter(
    df.stack().reset_index(), x="level_0", y=0, facet_col="level_1", facet_col_wrap=3
)
fig.update_layout({ax:{"visible":False, "matches":None} for ax in fig.to_dict()["layout"] if "axis" in ax})
  • matrix of all columns against all columns. Hide tick marks
px.scatter_matrix(df).update_layout({ax:{"tickmode":"array","tickvals":[]} for ax in fig.to_dict()["layout"] if "axis" in ax})
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!