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 : Impossible to set 0.0 and 1.0 on right ytick values outside a subplot

I am trying to display the yticks 0.0 and 1.0 on right y axis of a subplot (instead of 0 and 1) Here what I have done (with m and n the rows/columns of graph) : ax = g.subplots[m,n] ax.yaxis.tick_right() ax.yaxis.set_ticks_position('right') …
user1773603
0
votes
1 answer

Xticks gets accumulated in a small region

I am trying to plot a lineplot and have custom xticks in the plot. This is the code I have used: sns.set_style("darkgrid") sns.lineplot(y = mean_train_score, x = alpha, label = "Train") sns.scatterplot(y = mean_train_score, x = alpha, label =…
Aman Savaria
  • 164
  • 1
  • 1
  • 11
0
votes
1 answer

How do you rotate x axis tick labels in subplots?

I am trying to rotate the x axis labels for every subplot. Here is my code: fig.set_figheight(10) fig.set_figwidth(20) ax.set_xticklabels(dr_2012['State/UT'], rotation = 90) ax[0, 0].bar(dr_2012['State/UT'], dr_2012['Primary Total']) ax[0,…
queenkrazykat
  • 11
  • 1
  • 1
  • 1
0
votes
1 answer

Stacked plot with spaced xticks

I have done an aggregation which resulted in the following dataframe df2 = tweet.groupby(['Realdate', 'Type'])['Text'].count().unstack().fillna(0) Type BLM Black Realdate 2020-03-01 21.0 9.0 2020-03-02 20.0 …
bravopapa
  • 425
  • 4
  • 13
0
votes
1 answer

Matplotlib Line Plot with Months X Axis

Suppose i have a data frame "ltyc" of size (12,2) that looks like the following and I'm trying to plot a line plot using matplotlib and I need the x ticks to show the months only that are shown in the column of "time" below: time LT…
user2100039
  • 1,280
  • 2
  • 16
  • 31
0
votes
1 answer

Highlight some labels on the x-axis on seaborn barplot

I am using seaborn to plot the heritability of some brain regions. I want to highlight the labels on the x-axis based on the brain regions. So for example, let's say that I have regions that are White matter and regions that are grey matter. I want…
wwla
  • 41
  • 1
  • 9
0
votes
1 answer

Python/matplolib : auto-adjusting secondary tick labels (jupyter notebook using %matplotlib notebook)

I need help with the following issue: I am trying to plot some data using jupyter notebook in the matplotlib notebook mode. The x-values are time data in seconds, y-values are numpy.float64. I then convert the x-values to string values in the format…
SVct
  • 3
  • 4
0
votes
1 answer

Problem with plotting data with matplotlib using datetime format for xticks

I have a time series that I obtain from a numerical simulation with an integration time step of 1min. This time series spans several months and I want to use dates in the x-axis. Once the integration is over I add an epoch time corresponding with…
minmax
  • 129
  • 8
0
votes
2 answers

numbers in yaxis is not arranged in order in matplotlib

[the numbers in yaxis in the plot is not arranged in order while the word in x axis are too close. I am actually scraping wikipedia table for COVID19 cases, so i dont save as csv. i am only ploting it directly from the website.] my code also…
Temitope
  • 27
  • 5
0
votes
1 answer

How to set the range of minor ticks?

I'm working on a bar plot. The picture I've plot as following: To add the arrows in top and bottom axis, I set the spines color as 'none' first. Then I plot arrow by using axes.arrow() function. Finally, I reset the ticks by using…
keeptg
  • 27
  • 6
0
votes
1 answer

Setting matplotlib ticks

I'm having some issues in setting the ticks in my plots using matplotlib. What I need is to set the ticks inwards, so inside the figure (but the labels must stay outside), and at the same time I need to have ticks on all four boundaries. Do you know…
0
votes
0 answers

Clarification of Linespace Function

Can you explain this piece of code. I was trying to plot a graph with months on the X axis, I came across this piece of code and I am not able to understand the expression given for start and end parameter for the linespace() plt.xticks(…
0
votes
1 answer

Matplotlib : how to make appear and increase the size of minor and major ticks on x logscale axis

I am working on the plot of a (logscale,symlog) data. I have difficulties to make appear on x axis (logscale) the minor ticks with a visible height and width. In x axis, I have values starting from 1e-8 to 1. At the beginning, because of a reason…
user1773603
0
votes
2 answers

How do I modify the first label from 0.0 to 0 of the x axis in my graph?

I have tried to change 0.0 to 0 at the start of the x-axis when I have my graph. My numerical data are: x = 0.115, 0.234, 0.329, 0.443, 0.536, 0.654, 0.765, 0.846 y = 5.598, 7.6942, 9.1384, 11.2953, 12.4065, 15.736, 21.603, 31.4367 s = 0.05, 0.1,…
0
votes
2 answers

ggplot - Align ticks with axis

I am using the ndodge function explained by @jan-glx here; https://stackoverflow.com/a/60650595/13399047 However I could not figure out how to align the axis ticks aligned as for example; I should probably use theme(axis.ticks.length=) but I am not…
Jesse
  • 13
  • 5
1 2 3
16
17