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
2
votes
1 answer

X ticks axis in matplotlib

Plot Figure Hello Everyone, I am trying to plot a graph of contour but in very strange way the x values written in the x axis are not much to the real x values. I did not success solving that issue and wonder why this is happening. I tried changing…
2
votes
1 answer

How to make xticks in matplotlib evenly spaced despite their value, based on groupby?

I am trying to plot the average return by age for different companies. I want to have the age variable evenly spaced, though the stepsize increases and is not evenly distributed. My goal looks like this: fig, ax = plt.subplots(figsize=(10,6),…
Cosimo
  • 23
  • 5
2
votes
1 answer

xticks labels don't get displayed in Julia Plots (with pyplot backend)

I am basically trying to use this feature described in the Julia plots documentation plot!(xticks = ([0:π:3*π;], ["0", "\\pi", "2\\pi"])) My example looks like this: using Plots dat = rand(60*60*50) pyplot() plot( dat, xticks =…
lilianter
  • 23
  • 4
2
votes
1 answer

Even x ticks spacing in bar plots

I am trying to have my x tick evenly spaced using matplotlib. here is the problem plot; the code is below Issue: The x axis bars and values are not evenly spaced, despite my best efforts I would appreciate any and all help, thank you! here is the…
Messier51
  • 33
  • 4
2
votes
1 answer

Pyqtgraph plotwidget: cannot change font weight of axis ticks to BOLD

How can I make x axis ticks bold? plot_1 = pg.PlotWidget() plot_1.setBackground('w') pen = pg.mkPen(color="k", width=3, style=QtCore.Qt.SolidLine) plot_1 .setTitle("Title", color="k", size="18pt") plot_1 .plot(xvals, yvals, pen=pen) styles =…
jabbarlee
  • 110
  • 2
  • 11
2
votes
1 answer

How do I plot hours and minutes when they are in different pandas columns?

I have a pandas' dataframe like: hour minute cnt 0 0 904890 0 30 880374 1 0 848198 1 30 816488 2 0 791761 I would like to plot cnt using minute as minor ticks, and hour as major tick…
Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217
2
votes
1 answer

How to reflect the tick value in tooltip content in Google charts (Bubble Chart)

I am using Angular Google charts library. As per the official documentation, the value of x axis can only be a number. I wanted to plot the graph by string, hence i used hAxis.tick which changes the horizontal axis plot to string very well. However…
kirti
  • 47
  • 1
  • 9
2
votes
1 answer

Positioning of y values in Matplotlib - Matplotlib values don't follow tick positioning

I tried to find a solution but unfortunately nothing worked till now. I have this code example where the values are really close to the y axis on both sides and I would like to move them somewhat more to the center. Both ticks are supposed to be a…
2
votes
1 answer

Why does LogLocator give me only one tick per 2 decades?

First, the code. I'm using Jupyter Notebook 6.0.3 (which may or may not matter). import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np Nmax = 6 x = np.logspace(-1, Nmax) y = 1/x + x W = 8 plt.figure(figsize=(W,…
Ilya
  • 466
  • 2
  • 14
2
votes
1 answer

How to Customize datetime ticks in Plotly (Python)

so I've created a gantt chart with Plotly's Dash and I'd be quite happy, if it weren't for the x axis ticks. Here's my chart: Nice, but for the x axis ticks. I’d like to customize them to fit my needs: I’d like them to start on a monday (04 Jan),…
John
  • 31
  • 1
  • 4
2
votes
2 answers

Rounding the xtick values in a pandas plot

Is there an easy way to round the xtick values in a pandas plot? I plot the quantiles and this is what I get: pd.Series(argmax_indexes).quantile(np.arange(0,1.05, 0.05)) 0.00 500.0 0.05 560.8 0.10 582.8 0.15 589.0 0.20 593.0 0.25 …
user8270077
  • 4,621
  • 17
  • 75
  • 140
2
votes
2 answers

Set Xticks frequency to dataframe index

I currently have a dataframe that has as an index the years from 1990 to 2014 (25 rows). I want my plot to have the X axis with all the years showing. I'm using add_subplot as I plan to have 4 plots in this figure (all of them with the same X…
vgastaldi
  • 23
  • 1
  • 5
1
vote
2 answers

Setting xticks to the first day of the month

I´m practicing seaborn visualization with a database created from scratch. The point is that I want to see the data from this stock market prices visualizing only the first day of the month but the steps that it has are irregular: How can I indicate…
1
vote
1 answer

How to display all major and minor tick labels with log scale

I am trying to plot an xy-graph whose x-axis is logarithmic. I did that using this command: import matplotlib as plt plt.plot(X,Y) plt.xscale('log') The x-axis is logarithmic, but only values which are multiples of 10 are displayed in the graph,…
khashayar
  • 11
  • 3
1
vote
1 answer

How to decrease the bar width on a categorical x-axis

I want to plot one value on a bar plot but the bar is very thick, I want the bar to be thinner. import matplotlib.pyplot as plt # Data for the bar plot x = ['Category'] y = [10] # Create a figure and axis with a narrower width fig, ax =…