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

Adding XTickLabels to grouped individual bar graphs and plot on hold

I have two types of plots. In fist case I need to label individual bar graphs in the grouped bar plot. Here is the…
Kanjoo
  • 111
  • 1
  • 8
0
votes
1 answer

Why Backtrader doesn't show xticks when plotting graph?

it's weird my backtrader doesn't show xticks on most of my testing cases when i use cerebro.plot(style='candlestick'), I check it out on internet and find out it's not just me. Can anybody help us out there? Thanks!
Jeff Kwok
  • 1
  • 2
0
votes
0 answers

How do I remove double ticks (leaving a single set) on a color bar in matplotlib's imshow?

I'm using this: import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import AxesGrid plt.rcParams["axes.grid"] = False import seaborn as sns from mpl_toolkits.axes_grid1 import make_axes_locatable a = np.random.random((8, 8)) data =…
dcpetit
  • 3
  • 3
0
votes
1 answer

increasing font size of ticks

i have a simple x,y plot that i want to increase the font of of ticks on x and y axes, so that they match the font size of x,y labels - fontsize=30. i also need to change the spacing on both axes so that they look more or less like the picture…
sphero
  • 37
  • 9
0
votes
0 answers

How do I align xticks and xlabels in Matplotlib?

I'm trying to make a histogram with two columns and name the labels, but I don't understand how to align the labels with the columns. Here's what it looks like. Here is the code (months is the dataset I'm trying to plot): import matplotlib.pyplot as…
sanyer
  • 11
  • 1
0
votes
1 answer

Setting x and y limits not working in a figure I want to recreate

I want to make a figure like this The problem is that when I set xticks and yticks nothing happens. I have the code below import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.mpl.ticker as cmt import xarray…
meteo_96
  • 289
  • 2
  • 11
0
votes
1 answer

Trying to get a plotly graph object including both scatter and image to change xtick labels

I am creating a plotly figure, overlapping rectangles on an image and I want to change the xticks. Example Code: a = 255*np.random.random((28,28)) pil_img = Image.fromarray(a).convert('RGB') fig2 = go.Figure(data = [go.Scatter(x=[0,10,10,0],…
Keren
  • 167
  • 2
  • 12
0
votes
1 answer

Change y-axis ticks only on RHS

I'm looking to change the values at which there are ticks, for the right hand side y-axis (but NOT the left). Here's a MWE: import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot([1, 2, 3], [1, 2, 3]) ax.tick_params(axis="y",…
Elisabeth
  • 48
  • 5
0
votes
1 answer

Seaborn Pointplot xticks=Days do not appear in correct order, how to change it

My xticks of Days (categorical data from data frame) doesn't appear in correct order, how to change it? plt.figure(figsize=(13,6)) houragg =…
0
votes
1 answer

Change the fontsize of x/yticks in all subplots with same labels

I'm trying to make the font size of the x/yticks of each subplot larger. I've tried using ax.set_xticklabels(xlabels, Fontsize= ) but I don't want to specify new labels. I want the same ones that were defaulted on the plot (see image below). There…
Amanda C
  • 21
  • 5
0
votes
1 answer

Make ticks with values longer (Matplotlib)

This is my code for plotting import matplotlib.pyplot as plt nb = [days_data[d]["Netzeinspeisung"] for d in days_data] days = [d for d in days_data] plt.plot(days, nb, marker="+") plt.grid() days_label = [] for d in days: if…
Pythonwolf
  • 109
  • 1
  • 9
0
votes
0 answers

How to use multiple times xticks in a plot figure

I wanted to use xticks function 2 times on the x axis for the 2 plots but it doesn't work. I wanted to know a way to use the xticks tool to display my second axis on the top : my_xticks2 = ['524K','574K','Interpolation \n entre 524 et 574K','Melange…
0
votes
0 answers

How to customise date range in time series matplotlib?

I have a data for two years and I am using below code to create a time series graph: import matplotlib.pyplot as plt df = pd.read_csv("Sample.csv") # Draw Plot def plot_df(df, x, y, title="", xlabel='Date', ylabel='Number', dpi=100): …
Piyush Ghasiya
  • 515
  • 7
  • 25
0
votes
1 answer

How to set xtick to specific hours of the day

I have some data that has semi-random sub daily frequency and lasts for a few days, something like: date=[03/08/2011 00:00:00, 03/08/2011 03:30:00, 03/08/2011 06:45:00, 03/08/2011 12:00:00, 03/08/2011 15:30:00, 03/08/2011 20:15:00, 04/08/2011…
0
votes
1 answer

How can I change my plot so that my major axis is every 12 months rather than every 20 months?

I am trying to plot temperatures from January 2010 to December 2019. I am using the Pandas dataframe. I've been able to plot my data fine, it looks like this: It works, but the "major tick marks every 20 months" makes it hard to read. I was…