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

How to a handle a large number of axis labels?

As a beginner this is my first time using larger datasets for clustering. Can someone please help me with this problem. Here is my code: df1=BAR[['symbol','average_price']] plt.figure(figsize=(40,30)) …
1
vote
1 answer

How to show custom intervals on xticks for time series plots?

I'd like to change the xticks on my plot. Shown here is a time series for my parameter of interest, with y14 = years 1930-1959 y24 = years 1960-1989 y34 = years 1990-2020. Whereas B14, B24, and B34 are numbers ranging from 0-200. I want to change…
1
vote
1 answer

Reduce the number of xticks in matplotlib dynamically while plotting data of prices vs time

My python matplotlib script: plt.plot(graphdf["Price"],color='red') plt.xticks(rotation=90) Need help in reducing the number of ticks dynamically, my program scrapes data continuously and while plotting it the x-axis becomes jumbled after some…
Adithya
  • 23
  • 6
1
vote
1 answer

Rename x tick marks not numeric (POSIXct) ggplot

I want rename the x ticks marks with name localtimeat my graphic, which is "POSIXct" "POSIXt" My original localtime is in Portuguese, and I want to rename to English Dez = December Jan = January Fev = February Mar = March ps: I can't make an real…
1
vote
1 answer

How to rename existing xticklabels using dictionary in histagram

Encounter a problem, how to rename existing xticklabels in lineplot using dictionary ? Part of code: zodiac_order = ['Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio','Sagittarius', 'Capricorn', 'Aquarius', 'Pisces'] #…
unkind58
  • 117
  • 2
  • 11
1
vote
1 answer

Issues with subplots x-axis ticker in MatplotLib

Ive been struggling with this for a while and figured it was time to come here. Essentially I have two subplots being graphed and they're totally fine except for one thing, the x axis. For some reason one subplot's x-axis is coming out perfectly and…
The Don
  • 43
  • 11
1
vote
2 answers

Show more data of x axis

I have a plot which looks like this: How can I increase the number of years shown in the x axis so that it looks like this: As you can see it has shown all the years but the default setting on matplotlib does not show all the years. If I do…
Slartibartfast
  • 1,058
  • 4
  • 26
  • 60
1
vote
0 answers

Why are the x-tick-labels shifting when I'm using brokenaxis()?

I tried to plot a bar chart with broken y-axis. Without the broken axis it looks like this: plot without broken axis and with broken axis it looks like this: plot with broken axis I want the x-tick labels like on the figure without broken axis but I…
1
vote
1 answer

Matplotlib:How to avoid '0' on the x axis

I'm using this code to plot a bar chart: plt.figure(figsize=(8, 6)) plt.subplot(211) for i in instance.J: plt.bar(i, value(instance.P[i])) plt.xlabel('Generators',fontweight='bold') plt.ylabel('Power…
ViviAaron
  • 108
  • 9
1
vote
1 answer

Display only data on axis that is present in the figure

How do I hide the 32. and Jun, 14 2020 tickers that are not getting used. They don't exist in the data I provided. I'm setting locators like…
Maxxik CZ
  • 314
  • 2
  • 9
1
vote
0 answers

X-AXIS BREAK IN FORESTPLOT PACKAGE

I have created a graph using Forestplot package. The r-script is following: forestplot(row_names, OR, low, high, txt_gp=fpTxtGp(label=list(gpar(fontfamily="Arial")), ticks=gpar(cex=1.1), …
Omar
  • 11
  • 1
1
vote
1 answer

How to set two time formatters in matplotlib?

This chart is built by Excel. How can I do the same using matplotlib? I mean how to add two formatters: years months. Now i use something like this: fig, ax = plt.subplots(1,1) ax.margins(x=0) ax.plot(list(df['Date']), list(df['Value']),…
Igor K.
  • 813
  • 6
  • 17
1
vote
1 answer

Same x-ticks for all subplots in matplotlib

Though this question has already been asked, but I am unable to implement that. I don't know how get the xticks for each subplot and then replace it with the new one. The other problem is that in every subplot number of xticks labels are…
Talha Anwar
  • 2,699
  • 4
  • 23
  • 62
1
vote
1 answer

How to show xticks for all 365 distinct tick labels on the X-axis using matplotlib?

I have plotted two line plots. For Y-axis as the number of values are less, the Y-axis is clearly visible. However, for X-axis there are 365 values corresponding to 365 days of the year. For X-axis, the X-axis values look utterly cluttered. I have…
1
vote
0 answers

Align x and y axis with twinx twiny in log scale

I want to create a plot with two x axis and also two y axis. I am using twiny and twinx to do it. The secondary axis are just a rescaling of the original ones, so I'm applying a transformations to get the ticks. The problem is that I am in log…
rseppi
  • 21
  • 3