axis-labels

Relabelling ticks on Seaborn axes?

Relabelling ticks on Seaborn axes? Question: I’m doing a log-log plot with Seaborn; the data is actually derived from a StackOverflow developer survey. I tried using the built-in log scale, but the results didn’t make sense, so this simply calculates the logs before plotting. df = pd.DataFrame( {‘company_size_range’: {7800: 7.0, 7801: 700.0, 7802: 7.0, 7803: …

Total answers: 2

Setting title and axis labels

Setting title and axis labels Question: I’m trying to set my plot title and x and y label. Totals are all numbers float64. I’m trying to do it as simple as possible way. Here is the part of my code: plt.close(‘all’) cand_all =pd.DataFrame({‘Bachmann’:[total15], ‘Romney’:[total2], ‘Obama’:[total3], ‘Roemer’: [total4], ‘Pawlenty’:[total5], ‘Johnson’:[total6], ‘Paul’:[total7], ‘Santorum’:[total8], ‘Cain’:[total9], ‘Gingrich’:[total10], ‘McCotter’:[total12], ‘Huntsman’:[total13], …

Total answers: 1

Rotating the y-axis label

Rotating the y-axis label Question: I am trying to rotate the title of the Y axis so it is horizontal. I do not want the tick labels horizontal just the title of the Y axis. I have to use subplots as I am making multiple plots at once. Here is the below script in which …

Total answers: 2

How to set axis ticks in multiples of pi (Python) (matplotlib)

How to set axis ticks in multiples of pi (Python) (matplotlib) Question: I’d like to make a plot in Python and have x range display ticks in multiples of pi. Is there a good way to do this, not manually? I’m thinking of using matplotlib, but other options are fine. EDIT 3: EL_DON’s solution worked …

Total answers: 7

Set x and y label in one line

Set x and y label in one line Question: If I want to set the x, y label for each axis, I have to do something like this: import matplotlib.pyplot as plt plt.plot([1,2,3,4]) plt.ylabel(‘This is y label’) plt.xlabel(‘This is x label’) plt.show() I need to set xlabel, ylabel seperately. I’m wondering if there is any …

Total answers: 2

Python: How to increase/reduce the fontsize of x and y tick labels?

How to increase/reduce the fontsize of x and y tick labels Question: I seem to have a problem in figuring out how to increase or decrease the fontsize of both the x and y tick labels while using matplotlib. I am aware that there is the set_xticklabels(labels, fontdict=None, minor=False, **kwargs) function, but I failed to …

Total answers: 4

Matplotlib showing x-tick labels overlapping

Matplotlib showing x-tick labels overlapping Question: Have a look at the graph below: It’s a subplot of this larger figure: I see two problems with it. First, the x-axis labels overlap with one another (this is my major issue). Second. the location of the x-axis minor gridlines seems a bit wonky. On the left of …

Total answers: 3

How to display all label values in matplotlib

How to display all label values in matplotlib Question: I have two lists, when I plot with the following code, the x axis only shows up to 12 (max is 15). May I know how can I show all of the values in x list to the x axis? Thanks in advance. x = [4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3] …

Total answers: 2

Show decimal places and scientific notation on the axis of a matplotlib plot

Show decimal places and scientific notation on the axis Question: I am plotting some big numbers with matplotlib in a pyqt program using python 2.7. I have a y-axis that ranges from 1e+18 to 3e+18 (usually). I’d like to see each tick mark show values in scientific notation and with 2 decimal places. For example …

Total answers: 2

Polar chart x-axis label position using matplotlib

Polar chart x-axis label position using matplotlib Question: Using a Polar chart to represent some data, I would like to have the labels, currently positioned right above the x-axis, to be above the segment of data. So right between the axis. I’ve found multiple articles on how to rotate everything but it always keeps the …

Total answers: 1