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

Date format not rotating for xticks in one of the subplots for seaborn

I want to plot 2 subplots with their x-axis being date (which is the same for both x axis). However, when i do the plot, only one of the subplots got the xticks format i wanted. How do i make the xtick format work for both subplots? trend1 =…
jxn
  • 7,685
  • 28
  • 90
  • 172
1
vote
1 answer

MatplotLib move ticks on top and right axis inside only

I would like to move the ticks on my plot to the inside but only on the top and right axis. This is the code I am using ax.tick_params(top=True, right=True,…
1
vote
1 answer

Setting x-axis as Month from datetime arange of dataframe column using matplotlib plotting

How can I have the dates on the x-axis displayed as months, e.g. 'Jan', 'Feb'...'Dec'. instead of 2015-01, 2015-02,etc. I'm reproducing a shortened version of my df. I have read https://matplotlib.org/examples/api/date_demo.html and not sure how…
Bluetail
  • 1,093
  • 2
  • 13
  • 27
1
vote
1 answer

Increase the number of minor ticks

When I turn on minor ticks in a plot with something like plt.minorticks_on(), I often want to have a larger number of minor ticks. Is there a simple method to achieve that?
drevicko
  • 14,382
  • 15
  • 75
  • 97
1
vote
1 answer

How to change the frequency of labeling the x and y axis in matplotlib in python?

I am trying to plot a circle with a grid being shown. I wrote the following script which gives the below picture. However, the labels on the axes are interfering together. How to make the label appear (..,-10,-5,0,5,10,...) KEEPING the grid as it…
1
vote
1 answer

How to specify the value of the first tick in a graph using ggplot2 without changing the origin value?

Here is my data: X,Y 0,725 2500,695 4750,629 5000,605 5500,598 7000,616 8500,594 0,725 2250,695 4750,629 6500,640 9750,647 0,725 2250,695 4750,629 6500,640 10000,680 Here is my current code (excluding a bunch of geom_segments needed for this…
Juliet R
  • 203
  • 2
  • 5
  • 13
1
vote
1 answer

How to format x tick labels of a quantiles barplot in pandas

I have a small Pandas dataframe containing quantiles and I would like to plot them through a barplot. Although the quantiles which appear on the index of the Pandas dataframe are rounded to 2 decimal digits when they are plotted the appear with…
user8270077
  • 4,621
  • 17
  • 75
  • 140
1
vote
1 answer

Date format issues in plot ticks with matplotlib.dates (and datestr2num)

I'm using matplotlib.dates to plot a bar chart with instances occurring on specific dates (presented as a list of strings), and using matplotlib.dates.datestr2num to display two sets of data per date (as per the top answer in Python matplotlib…
gatheloc
  • 13
  • 3
1
vote
4 answers

xticks and yticks not displaying few values in scatterplot using matplotlib

Problem: Unable to identify why the xticks and yticks are missing few values from the list provided My code is as follows: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as…
1
vote
0 answers

setting xticks in xarray line plot with cftime dates

I'm trying to set the tick frequency on an xarray line plot. I managed to set the limits but I can't get the ticklocator to work. This should work similar to pandas. import cftime import…
0
votes
1 answer

Some labels and ticks from previous plot are also there even after setting new ticks and their labels. I don't want these. .plot() method of pandas

I am plotting time series data using DataFrame.plot() method of pandas. Below is the code: import pandas as pd import matplotlib.pyplot as plt import numpy.random as rn series_dt =…
Ali Haider
  • 25
  • 4
0
votes
0 answers

Is there a way to have multiple xtick label lists in Python Matplotlib plot xticks?

Using Python with %pylab (Matplotlib & Numpy). Need a very particular xtick label layout consisting of 3 rows, the first of which has a different orientation to the rest. This is a mock up below. Example x-labels I can add multiple lines to the…
0
votes
0 answers

how to change the label pad of a single x coordinate using matplotlib?

I have seen several questions about changing the label pad, and changing the a single x-axis label, but not for changing the label pad for a single x-axis label! I have a graph that I am using to represent a range, and then the user score populates…
Nathan
  • 65
  • 5
0
votes
0 answers

How to remove unwanted ticks from histogram and place ticks in dead centre

I'm fairly new to the concept of binning and histograms and am having the following issue: I want integer ticks to fall in the centre of my histogram bins. The values would need to be rounded, hence np.round in my code. I'll attach the relevant code…
0
votes
0 answers

Use strings as parameters for Matplotlib

I want to generate parameters for figures dynamically, pass as arguments to Matplotlib. Example to illustrate, this works: dict = {'x_tick_fontsize':12 ,'x_tick_weight':'normal','x_tick_rotation':15} plt.xticks(fontsize =…
Programming_Learner_DK
  • 1,509
  • 4
  • 23
  • 49