Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
69 views

I have a scatterplot in pyplot where the x-values are necessarily strings. Is there an easy way to limit the number of xticklabels that pyplot will show? I am not referring to specifying the xticks ...
Alex V.'s user avatar
  • 550
2 votes
2 answers
87 views

I have to create a plot on which ticks and labels are specifically defined; an example of reproducible plot is given below: import matplotlib.pyplot as plt import seaborn as sns plt.style.use('seaborn-...
Andrew's user avatar
  • 1,226
0 votes
0 answers
156 views

I am plotting some functions in Typst with the cetz-plot package. #import "@preview/cetz:0.3.4": canvas #import "@preview/cetz-plot:0.1.1": plot #set page(width: auto, height: ...
falsePockets's user avatar
  • 4,483
0 votes
1 answer
114 views

When you create a plot with matplotlib.pyplot (plt), and call the grid with plt.grid(), from what I understand a call is made to plt.Locator class. I was wondering if there is a simple way, through ...
n6r5's user avatar
  • 364
0 votes
1 answer
83 views

I want the histogram edges to line up with the xticks of my chart. Other SO and answers I've read focus on calculating the bins and passing them. I've done this yet still can't get them to align: I'...
Python_Learner's user avatar
1 vote
2 answers
183 views

I have a pandas dataframe which is basically a pivot table. df.plot(kind = "bar",stacked = True) results in following plot. The labels in x-axis are congested as shown. In Excel I can group ...
hbstha123's user avatar
  • 1,850
0 votes
1 answer
84 views

When using the log scale with matplotlib, we can set globally with (see this answer) import matplotlib.pyplot as plt plt.rcParams['axes.formatter.min_exponent'] = 3 that ticks on logarithmic axes are ...
Walter's user avatar
  • 45.9k
0 votes
1 answer
50 views

Concerning this jsfiddle which uses chartjs v3.9.1 and the date-fns adapter: https://jsfiddle.net/0a6c1ty5/22/ I'm trying to format the tick labels in the function tick_label but I'm only getting a ...
ErikR's user avatar
  • 52.2k
0 votes
0 answers
99 views

I have a pandas dataframe with hourly data shown in 7 subplots for a weeks data. fig = make_subplots( rows=7, cols=1, subplot_titles=subPlotNames, shared_xaxes=True, shared_yaxes='...
juerg's user avatar
  • 519
0 votes
1 answer
46 views

Surely already asked, but I'm struggling to find a clear solution that fits my case. How to shift ticks between grouped boxplots (rather than centered on them) so that to define hours intervals? ...
denis's user avatar
  • 1,248
2 votes
2 answers
312 views

I am trying to produce a figure with multiple subplots where the axis tick labels of each subplot should be formatting in the same way. As the numbers are large, displaying tick labels in a legible ...
Paddy Cahalane's user avatar
1 vote
3 answers
103 views

I am trying to plot a stacked bar chart using pandas dataframe plot method. The x values are floats and I am trying to set xticks at integer intervals with no success. Here is my code import pandas as ...
Nitin's user avatar
  • 113
2 votes
2 answers
220 views

I'd like to invert the direction of a single axis tick (and its label) along the x-axis to highlight some specified value. I was successful in manipulating other attributes but apparently inverting ...
Biggzlar's user avatar
0 votes
0 answers
74 views

I would like to mark max/min value as yticks like below: import plotly.graph_objects as go import pandas as pd import plotly.express as px def save_fig(fig,pngname): fig.write_image(pngname,...
lucky1928's user avatar
  • 9,051
0 votes
1 answer
89 views

My x tick labels are crossing the x-axis into the chart area and I don't want them to, an example: Another oddity is my x axis ticks stopped showing. I've tried: making ticks visible and, adjusting ...
Python_Learner's user avatar
0 votes
2 answers
39 views

plt.plot(neighbors, train_scores, label="Train Score") plt.plot(neighbors, test_scores, label="Test Score") plt.xticks(np.arange(1,21,1)) plt.xlabel("Number of Neighbors")...
Atharv Patil's user avatar
1 vote
0 answers
62 views

When I create a figure with shared axes, by default the tick labels go on the leftmost and bottom-most axes. import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots(2,2, sharex=True)...
dkv's user avatar
  • 7,462
0 votes
1 answer
165 views

I have made a plot with sns.axes_style("dark"). I want to put ticks on this plot, in the same way that the default style has ticks. Moreover, the scale of both axes is logarithmic and I ...
Chryssi Koukouraki's user avatar
2 votes
1 answer
152 views

I am fairly new to Matplotlib and appreciate your help with my question: I am looking to generate a figure that each label has 2 colors. For example, a label named 'first_color\nsecond_color', first ...
hara's user avatar
  • 23
4 votes
2 answers
592 views

I have written a Python script (below) to produce a Matplotlib plot to display boxplot data grouped together by subgroups (season), groups (city), and different colors (year). However, the group (city)...
Vuro H's user avatar
  • 41
0 votes
1 answer
78 views

I am trying to change the fontsize of xticks and yticks in python. The plot represents daily averages for a random location for December 2019. My problem is that I sent set yticks fontsize to 26 but ...
Dimitris Tsiaousidis's user avatar
5 votes
0 answers
4k views

I faced a warning message when trying to rotate xticks of seaborn.lineplot. At first, I tried to run set_ticks, but ax doesn't seem to have this function. I also checked FixedLocator, but haven't ...
dmjy's user avatar
  • 1,903
0 votes
1 answer
37 views

I'm trying to make 2 separate bar plots, one of which is a subset of the other. I can set the xticks of the full dataset just fine and get the result I'm expecting, but when I set the xticks of the ...
user23304415's user avatar
1 vote
1 answer
72 views

Trying to get rid of on x axis overlapping issue. I couldn't change angle of the values # Create a figure with sharing x-axis fig, ax1 = plt.subplots(figsize=(10, 6)) # weekly order count on the ...
Eren 's user avatar
  • 11
1 vote
2 answers
146 views

Consider the plot below. Both axis have custom labels, to label the rows and columns in an imshow-plot. The problem now is that the y-axis has very large values. Ideally I'd like to manually set an ...
flawr's user avatar
  • 11.7k
1 vote
1 answer
57 views

Here is my plot: generated from the python code import numpy as np import matplotlib.pyplot as plt plt.figure(figsize=(20, 10)) n = 70 x = [f'{i}{val}' for i,val in enumerate(np.arange(n)[::-1])] y =...
Toonia's user avatar
  • 195
0 votes
0 answers
213 views

I've imported data from an Excel file and I plot it with Matplotlib. If I use only default settings I get accurate results with correct tick labels, even if not formatted the way I want. df.plot() But ...
Michael Stern's user avatar
0 votes
1 answer
83 views

What causes the x-axis to have Year numbers in between the bars and the 0.5 attached to the Population Year ru = px.bar(wakel, x = "Population Year", y = "Population", color = &...
Thomas Hugen's user avatar
1 vote
2 answers
138 views

For example: import matplotlib.pyplot as plt import numpy as np x = np.arange(0.0,1.2,0.2) y = np.arange(0.0,1.2,0.2) labels = np.arange(0.0,1.2,0.2) plt.plot(x, y) plt.xticks(x, labels) plt.show() ...
Firestar-Reimu's user avatar
0 votes
1 answer
77 views

This is my example code and output. import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates # Create a DataFrame with a date column and another column with the data you ...
user3685918's user avatar
0 votes
0 answers
55 views

I have the following small program in which I use rc("text", usetex = True) in order to allow some formatting. I thought that the line ax.set_xticklabels(ax.get_xticks(), weight='bold') ...
Andrew's user avatar
  • 1,226
1 vote
1 answer
218 views

I would like to move the line of the x-axis (with all the corresponding ticks) x=0. But the tick-labels should be positioned at the bottom of the figure, to prevent clutter in the graph. Show axis at ...
3dSpatialUser's user avatar
3 votes
1 answer
116 views

I am drawing a line chart using matplotlib as shown below. import matplotlib.pyplot as plt import pandas as pd import io temp = u""" tenor,yield 1M,5.381 3M,5.451 6M,5.505 1Y,5.393 5Y,...
user3685918's user avatar
0 votes
1 answer
33 views

I created a bar plot/hist of categorical data and I iterated over the number of records. The problem is the x-ticks are not centered. And somehow there's a zero there that comes from nowhere! Could ...
user6688's user avatar
1 vote
1 answer
451 views

Here is the problem: I have two implicit functions F and G. I am trying to find a way to plot them using SymPy. My question is, how to adjust ticks on x- and y-axis, so I can see a crossing point of ...
Alena's user avatar
  • 15
1 vote
2 answers
404 views

In python's matplotlib, how can I make the logarithm x-axis ticks as the attached picture shows (i.e., major ticks with labels at every 0.5 spacing from 1 to 4.5; minor ticks without labels at every 0....
Leo's user avatar
  • 37
1 vote
1 answer
302 views

I'm trying to remove labels every other tick starting from 2, I'm unable to do this when I use nested labels with ggh4x package. My second question: Is there a way to move "AUG" and "...
forecaster's user avatar
  • 1,159
4 votes
2 answers
101 views

I am trying to change the color of the ticklines in my plot, where I would like to assign the colors based on a list of strings with color codes. I am following the following approach, but I cannot ...
HWIK's user avatar
  • 69
0 votes
0 answers
69 views

The dataframe df has a datetime index ranging from 2019-12-02 to 2020-01-30 and I can plot it fine using mplfinance's plot function: But as soon as I set the tick locators, the tick values get messed ...
Saeed's user avatar
  • 2,161
0 votes
1 answer
558 views

I've been looking all over for a way to evenly space dates using Python 3 with matplotlib, and I haven't been able to find anything that would apply to just having a list of datetime objects. I'm ...
Max's user avatar
  • 39
0 votes
0 answers
40 views

I am trying to make a combined plot using seaborn boxplot and scatterplot. The problem is that my xtick labels are not aligned and I've tried many solutions. the red data values are the values that ...
user2100039's user avatar
  • 1,366
2 votes
1 answer
1k views

How do I make it so that it shows all x ticks from 0 to 9? bin diff 1 4 -0.032748 3 9 0.106409 13 7 0.057214 17 3 0.157840 19 0 -0.086567 ... ... ... 1941 ...
guckmalmensch's user avatar
0 votes
1 answer
107 views

I need to be able to compare graphs that show the progress of several variables over time. I need to do this for different cases, where the time covered is not always the same: now the data visualised ...
rdv's user avatar
  • 732
0 votes
2 answers
452 views

I have a seaborn lineplot that shows two categories' quarterly count changes. The issue is that the x-axis labels are one position ahead of the data points. I adjusted my code, but it didn't help. ...
Osca's user avatar
  • 1,744
1 vote
0 answers
42 views

I am making exchange rate chart with 3.3.2 version of Chart.js I want to make Xticks values to this [3 months ago, 1 month ago, 1 week ago, 1 day ago] with same interval. enter image description here ...
user22516863's user avatar
0 votes
1 answer
40 views

I have: X = [1,5,3,4,2] Y = [10, 14, 11, 9, 10] plt.plot(X,Y,'o') plots x-axis ticks from 1 to 5. I want the x-axis to show values 1,5,3,4,2 in this order. Is there a way?
sku's user avatar
  • 137
-1 votes
2 answers
361 views

I am trying to make my column density plot axes look like the ones on the image presented so that I can present my work alongside a previous work using similar format. I am struggling to format my ...
Teo Georgatos's user avatar
1 vote
2 answers
673 views

I´m practicing seaborn visualization with a database created from scratch. The point is that I want to see the data from this stock market prices visualizing only the first day of the month but the ...
Manuel Veiga's user avatar
0 votes
1 answer
56 views

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 = pd.Series(rn....
Ali Haider's user avatar
-1 votes
1 answer
58 views

I'm using the code below to produce a chart in seaborn. I have included the values for score_train, score_test and alphas so that you could replicate if you try to run my code. alphas = [0.00000000e+...
Zain's user avatar
  • 125

1
2 3 4 5
7