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

matplotlib - replace xtick labels values with log format by others label values

I have the following code snippet to do a plot with logscale for x-axis : # Number of values for loop num_prior_loop = 100 # Declare prior array prior_fish = np.zeros(num_prior_loop) prior_start = 0 prior_end = 3 prior_fish =…
user1773603
0
votes
1 answer

matplotlib seaborn heatmap x,y meshgrid logscale issue

So my problem is, that I would like to plot several heatmaps as a multiplot, where I have the X,Y axis logarithmic, and also add patches to the heatmap, to highlight certain areas with tuning alpha values (see attached image). The thing is, that…
0
votes
1 answer

How to format axes ticks to significant digits in matplotlib

I am wondering if there is any way in matplotlib to control the axes ticks with significant digits, instead of controling by the number of decimals. For instance, the following numbers: 2, 15, 120 should be written as 2.00, 15.0, 120
Radvin
  • 143
  • 4
  • 10
0
votes
1 answer

How do I solve this too crowded x-axis when x-ticks does not work?

Context: The Data is on the millisecond and is in the following format: '08:04:18.795' '08:13:15.496' Now what I want is to create specific time brackets (e.g. 08-11, 11-14, 14-17, etc.). If I plot this I get a too crowded x-axis where nothing is…
PeterPost
  • 1
  • 1
0
votes
1 answer

ggplot: Adding a plot outline with the axis ticks

I'm trying to create plots where the x-axis ALSO appears above the plot as well as the y-axis to the right of the plot. Both should contain the same ticks as the normal axis, but NOT the axis text. This should result in a "box" with helpful…
pleasehelp
  • 87
  • 6
0
votes
3 answers

Matplotlib xticks ranges & labels issue

Could you please advise on how to solve next Matplotlib xticks ranges & labels issue I am facing with a couple of Python cases? I am trying to plot a couple of double charts (1 X 2) however, xticks ranges and labels showed are not in the way…
0
votes
2 answers

How to change frequency of x-axis tick label of datetime data

I try to plot some speed time graph in spyder, and I did some plots. My problem is the x label. I want to write the time in the x plane as 2012 2013 2014 2015 2016 but I can't. Here is my code import pandas as pd import datetime import…
0
votes
1 answer

Creating xticks in Python plot based on a range

I'm trying to change the xticks in a Python graph from a long list of 280 values (all numbers) to only show every 20 or so. Here is the code I've been playing with: p = 20 ax.xaxis.set_ticks(range(0,len(x), p), [x[i] for i in range(len(x)) if i % p…
0
votes
1 answer

How do I add tick labels to a pandas plot?

I have a pandas data frame that I have graphed in a plot but for some reason I can't get my plot to have xtick labels. I have tried using matplotlib but it doesn't seem to work. Here is what I have for the plot. wsdf =…
0
votes
1 answer

Awkward scientific notation on the axis in matplotlib

So I would like to change the way the numbers are presented on the x and y axis. I would either like no powers being represented at all or the powers in each individual tick. Is this possible? indx = np.where(time > 0.28549) # indexs where i want to…
mike
  • 21
  • 3
0
votes
1 answer

How to custom ticks and bars in Python?

I want to see the frequency of occurrence of some event, when my event happened and when didn’t. How can I custom the plot in a way that have years on the x-axis from 1970 to 2020 in order (1years interval), and have the bars where there are data…
sam_sam
  • 449
  • 1
  • 5
  • 16
0
votes
1 answer

matplotlib minus sign in tick labels has bad formatting

Matplotlib appears to use the "correct" unicode character for a minus sign in tick labels if they are set automatically. However, if I try to set them manually, it appears that it instead uses a hyphen (which looks way too small and generally bad).…
leebs92
  • 3
  • 4
0
votes
1 answer

How to stop x labels from displaying after a certain value

I'm having the hardest time achieving the following: I need to stop the x labels from showing after the vertical dashed line seen in the image: Basically, I want to eliminate the 5 in this example. I successfully stopped the ticks with the…
lmm_5000
  • 139
  • 8
0
votes
1 answer

xticks on only bin ticks

I have a dataframe with datetime data, whose columns tell how many days are from various holidays. I'd like to create histograms of that data, and I tried the following code: holiday_features = [name for name in df.columns if 'DAYS FROM' in…
Yehuda
  • 1,787
  • 2
  • 15
  • 49
0
votes
0 answers

minor ticks with subplots not working in matplotlib python

I need to put minor ticks in the x axis in subplots. This is my script, What I need to change in it? #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from matplotlib import rc import matplotlib.pyplot as…
Hdez
  • 151
  • 7