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
0
votes
2 answers

How to center the xticks from a bar chart

I was following this tutorial to add value in my bar chart link The code that shown in the blog written like this from matplotlib import pyplot as plt import numpy as np years = [1901, 1911, 1921, 1931, 1941, 1951, 1961, 1971, 1981, 1991, 2001,…
theDreamer911
  • 85
  • 1
  • 9
0
votes
1 answer

Adjust x ticks for a hour column of a dataframe in plotly

Plotted using Autoplotter in jupyter where hours are in countsplot of Timestamp Vs Temp I have a csv file, that contains a column called hours. While plotting that in x axis for line graph in plotly , it is getting represented in the form of counts…
chat_dev
  • 7
  • 2
0
votes
0 answers

How to plot ALL xlabels?

I'm trying to plot a graph from a dataframe stat with labels as individual letters on the x-axis, that are in the index of stat. But instead of ALL letters, only a few are shown to me, although there is enough space on the x- axis for everyone. I…
0
votes
1 answer

Set xticks relative to the plot coordinates

Is there a simple way to set two xticks at even distances from the xmin and xmax, for two plots with different ranges on the x-axis? # Example: from matplotlib import pyplot as plt import matplotlib.gridspec as gridspec fig =…
C.L.
  • 106
  • 6
0
votes
1 answer

seaborn scatterplot x/y ticks datatype are switched (float values to int, and vice versa)

I'm using seaborn scatterplot to plot engine 'liter' values (float) vs engine 'cylinder' values (integer). There are three 'cylinder' values- 4, 6, and 8. However the ticks for cylinders on the scatterplot appear as floats- 4.0, 4.5, 5.0, 5.5,…
0
votes
1 answer

Mixing horizontal and vertical ticks

I have the example plot shown below. How can I make the first and third x-axis tick horizontal and the second and fourth tick vertical? import matplotlib.pyplot as plt x = [1, 2, 3, 4] y = [1, 4, 9, 6] labels = ['Frogs', 'Hogs', 'Bogs',…
machinery
  • 5,972
  • 12
  • 67
  • 118
0
votes
0 answers

Seaborn Heatmap - Remove Excess Repeated Xticks

I am working with my genes expression dataset and created this heatmap: On the X axis of this heatmap, I have my different cell types. I want to have only one xtick in the center of each cell type and remove all of the other excess…
Ofir Shorer
  • 446
  • 1
  • 6
  • 16
0
votes
1 answer

arrange values and labels on plots yticks-xticks

height_str=headers[1:] #height format str height=[float(i) for i in height_str] #height format float -type:LIST plt.yticks((height),height_str) #height y axis Hello. I would like to display the values and labels in a better range on the…
Steren
  • 127
  • 2
  • 10
0
votes
1 answer

How to plot graph and correct date ticks?

I am trying to plot a graph that has dates (I want years and months as x-ticks). But when I try to plot the graph I either get the correct ticks but no graph showing (this is when I have ax.plot()... at the end) or the graph showing but getting the…
NANnl
  • 13
  • 3
0
votes
1 answer

Secondary x axis labels

I have two csv files that have been generated on one chronological basis during my recording (they both have a timestamp column based on one clock). I want to plot my data in matplotlib (or elsewhere using python, if you have a better…
0
votes
1 answer

Python: Adaptive xticks for matplotlib

Good evening For a coding exercise I am generating a plot with matplotlib. Let f be a real-valued function (which is unimportant for my question). I'm now having trouble with my xticks spacing, as n (amount of data) gets large. Do you know how to…
0
votes
0 answers

Minor Grid Lines in a matplotlib Log Plot

I can plot minor grid lines in a matplotlib log plot like this: lx = [6,60,100,6] ly = [40,6,100,40] fig, ax = plt.subplots(1,1); plt.plot(lx, ly,'-', color='k', linewidth=5) ax.set_yscale('log') ax.grid(True, which='both',…
R. Cox
  • 819
  • 8
  • 25
0
votes
1 answer

Changing tick labels in loglog plot

The default plot puts scientific notation in the x axis labels. These labels are 2,3,4, and 6, so that doesn't make much sense. Traditional methods seem to rely on the 'ScalarFormatter' which, is not used in log space... import numpy as np import…
0
votes
1 answer

matplotlib xticks outputs wrong array

I am trying to plot a time series, which looks like this ts 2020-01-01 00:00:00 1300.0 2020-01-01 01:00:00 1300.0 2020-01-01 02:00:00 1300.0 2020-01-01 03:00:00 1300.0 2020-01-01 04:00:00 1300.0 ... …
oakca
  • 1,408
  • 1
  • 18
  • 40
0
votes
0 answers

Problem with minor ticks in matplotlib, order matters don't know why

I am plotting data using the following code: import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator, FormatStrFormatter Ed={"vCs":-5811.63801749,"vSb":-5352.588077,…