Questions tagged [xticks]

For questions related to xticks in matplotlib, seaborn, or pandas plots.

"xticks" refers mainly to a submodule of the python plotting library matplotlib which handels the ticks of the x axis. But this tag is in general not limited to python or matplotlib but can be used whenever one refers to position and appearance of ticks and marks at the axes of a graph.

255 questions
1
vote
1 answer

How to format the timeseries axis of a matplotlib plot like a pandas plot

I've created following graph with pd.Series([1]*month_limits.size, month_limits).plot(ax=ax) How do I recreate same x ticks labels with just matplotlib? I mean years and month not overriding each other Best I got is having years and months at the…
bottledmind
  • 603
  • 3
  • 10
1
vote
1 answer

how to interpolate y to get x from plotted data in Octave

I have a 2D graph of data. Instead of interpolating y from x, I need to determine the x value given y. I can't find any information on this specifically for Octave. Would someone please enlighten me? My code is below: I also would really…
cmp
  • 21
  • 5
1
vote
2 answers

Line graph not lining up with correct x-ticks

I have list generated from a function I created. I am integrating a graph into my function output. As I am testing my graph the ticks on the x axis do not align with the correct points on the graph; they are offset by 1. The data at tick 0 should be…
1
vote
2 answers

Custom xticks in seaborn heatmap

I have the following heatmap (just a minimum working example, my data is huge!) df = pd.DataFrame({'set1': ['0', '2', '2'], 'set2': ['1', '2', '0'], 'set3': ['0', '2', '1'], 'set4': ['1', '4',…
Caterina
  • 775
  • 9
  • 26
1
vote
0 answers

Plotly custom tick labels in between ticks on heatmap

I have a heatmap with custom ticks (custom location and custom label). I would like the label to appear in between ticks. So far I managed to get this: import numpy as np import plotly.graph_objects as go np.random.seed(13) N = 100 M = 30 ticks =…
leleogere
  • 908
  • 2
  • 15
1
vote
1 answer

How to set values of a vertical stem plot as xticks labels?

I would like to reverse a grouped data and use group name as xtick label to draw it side by side. below demo mostly good but the label position not as expected. import pandas as pd import matplotlib.pyplot as plt import numpy as np def main(): …
lucky1928
  • 8,708
  • 10
  • 43
  • 92
1
vote
1 answer

Matplotlib - Force 2 subplots to have same tick labels without changing data and plot

Given import matplotlib.pyplot as plt import random fig, ax = plt.subplots(1, 2, figsize = [9, 5], dpi = 100) xs = [random.randint(-10, 10) for _ in range(10)] ys = [random.randint(-10, 10) for _ in range(10)] xx = [random.randint(-20, 20) for _…
hexaquark
  • 883
  • 4
  • 16
1
vote
2 answers

Reducing the number of labels on x-axis of plot

Im learning matplotlib, and trying to draw a simple scatter plot that has dates on the x-axis and values on the y. There are 2200 dates, from 2004 to 2019, (format 2014-09-17 type O). Heres my…
1
vote
1 answer

Adjusting the space between datapoints on a seaborn swarm/scatter plot

I am searching for a way to adjust the space between data points (red arrows) and between the x-ticks (green arrows) on a seaborn strip- or swarm-plot. import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as…
Broxy
  • 90
  • 7
1
vote
2 answers

How can I build custom xticklabels using numbers and strings?

I am trying to customize the Xticklabels of my bar graph to have a format of 'number (units)' So far I have a vector: scanrate = [2;4;6;8;10]; I want my bar graph to have an x axis of: 2mv/s 4mv/s 6mv/s 8mv/s 10mv/s If I use…
Mitchell
  • 13
  • 2
1
vote
2 answers

How to add multiple custom ticks to seaborn boxplot

I generated a boxplot using seaborn. On the x axis, I would like to have, both the number of days (20, 25, 32) and the actual dates they refer to (2022-05-08, 2022-05-13, 2022-05-20). I found a potential solution at the following link add custom…
Amilovsky
  • 397
  • 6
  • 15
1
vote
2 answers

How do i apply a xticks rotation on all my subplots?

I am kind of stuck with this, I searched on google for an answer but I can not find it. I would like to turn my xticks 45 degrees of my subplot. I know how to do it for a normal plot: plt.xticks(rotation = 45) But when I put this in my plot script…
SimonDL
  • 186
  • 10
1
vote
1 answer

Change X ticks for axes subplot

I am trying to set the x ticks of my axes subplot but it is not working for me. Right now I have the following data frame: Data Frame I am using the following code to plot…
MIGB91
  • 13
  • 3
1
vote
1 answer

Matlab Anova changing "Test number" on x axis

Using the built in Matlab function to run ANOVA on some data. I have groups of tests that I want to look at independently of the other tests, i.e. I want to run ANOVA on tests 1, 2 & 3, then 4, 5 & 6 and so on but when I look at 4, 5 & 6 the built…
user2587726
  • 169
  • 2
  • 11
1
vote
0 answers

Changing label of x-tick for 0 if any using Matplotlib

I am trying to plot a graph using matplotlib. The challenge arises, as I want to keep all of the tick labels on the x axis, except for 0 which I want to change to 1. I will be doing a lot of plots, with different x-lims, so the solution needs to…