axis-labels Questions

5

Solved

I'm plotting a histogram using the matplotlib.pyplot module and I am wondering how I can force the y-axis labels to only show integers (e.g. 0, 1, 2, 3 etc.) and not decimals (e.g. 0., 0.5, 1., 1.5...
Dannadannel asked 21/8, 2012 at 7:48

3

Solved

This post describes a method to create a two-line x-axis (year below months) on a time series plot. Unfortunately, the method that I use from this post (option 2) is not compatible with ggsave(). ...
Nieshanieto asked 28/9, 2018 at 11:56

3

Solved

I want to plot a large data range but have ability to zoom in and gain resolution. I need to use custom major and minor tick formatting therefore I lose the ability to have them set dynamically wit...
Regeneracy asked 5/3, 2015 at 0:51

6

Solved

I'm trying to use my own labels for a Seaborn barplot with the following code: import pandas as pd import seaborn as sns fake = pd.DataFrame({'cat': ['red', 'green', 'blue'], 'val': [1, 2, 3]}) f...
Gerent asked 26/7, 2015 at 1:8

3

Solved

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 scientifi...
Chelsae asked 9/9, 2014 at 16:59

6

Solved

Check the x axis of the figure below. How can I move the labels a bit to the left so that they align with their respective ticks? I'm rotating the labels using: ax.set_xticks(xlabels_positions) a...
Hackbut asked 13/2, 2013 at 11:46

7

Solved

How do I add text labels to axes in d3? For instance, I have a simple line graph with an x and y axis. On my x-axis, I have ticks from 1 to 10. I want the word "days" to appear underneath it so p...
Lientery asked 25/6, 2012 at 12:20

2

Solved

For example in the following code: import numpy as np import matplotlib.pyplot as plt N = 10 x = [1,2,3,4,5,6,7,8,9,10] y = np.random.rand(N) plt.scatter(x, y) plt.show() I get the following plo...
Galvano asked 13/2, 2015 at 19:7

2

I have imported: %matplotlib inline %config InlineBackend.fugure_format = 'retina' import matplotlib.pyplot as plt to show: plt.plot(train_losses, label='Training loss') plt.plot(test_losses, labe...
Pemba asked 4/6, 2019 at 15:34

7

Solved

I would like the levels of two different nested grouping variables to appear on separate lines below the plot, and not in the legend. What I have right now is this code: data <- read.table(text...
Vasomotor asked 10/8, 2013 at 20:4

7

Solved

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. ...
Unwinking asked 16/11, 2016 at 20:51

3

Solved

I combined 2 charts and I am trying to add the second y-axis, but every time I add the yaxis = "y2" to my code, I lose have the my bar graphs. > MediaDate Spend Search_Visits Other_Visits Media...
Dort asked 7/9, 2016 at 23:0

2

Solved

I have a ggplot map, for example: library(ggmap) ggmap(get_map()) I'd like the axis labels to be automatically labeled as N-S / W-E: in the above case, for example, instead of lon -95.4 it shoul...
Flipflop asked 23/10, 2015 at 12:31

1

Solved

I would like to plot the following data and I cannot seem to get matplotlib to show more axis labels. import matplotlib.pyplot as plt from matplotlib.ticker import LogLocator, LogFormatterMathtext ...
Marciamarciano asked 10/11, 2022 at 20:28

2

Solved

Is there a way to increase the padding/offset of the polar plot tick labels (theta)? import matplotlib import numpy as np from matplotlib.pyplot import figure, show, grid # make a square figure f...
Warmedover asked 18/6, 2013 at 2:26

2

Solved

I am using the SPEI package along with its sample monthly data of 32 years. I want to modify the x-axis labels to reflect the years not the numbers. However, the hard coded plotting function won't ...
Stamey asked 2/5, 2019 at 22:3

1

Solved

My minimal example: test_df <- data.frame(Year = 1929:2021, mydata = 1:93) ggplot(test_df, aes(x = Year, y = mydata )) + geom_line() + labs(y = "S&P 500 EPS / Nominal GDP Normalized...
Acrodont asked 29/10, 2022 at 3:55

2

Solved

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...
Dissonance asked 30/9, 2014 at 23:23

1

Using ggplot I am able to stagger the x-axis labels using the scale_x_discrete function library(tidyverse) tibble(A = factor(LETTERS[1:5]), B = c(abs(rnorm(5)))) %>% ggplot(aes(x=A, y=B))+ ge...
Leeth asked 7/9, 2022 at 12:3

1

Solved

In order to get rid of non-trading days of stocks (aka weekends) in ggplot instead of the date, I use the number of rows in the data and then add breaks and labels. The code below "works"...
Fatidic asked 20/7, 2022 at 15:50

3

Solved

When making a graph, ggplot2 has a lot of sensible defaults for scales that require extra work when trying to achieve the same result using scales. An example: library("ggplot2") ggplot(m...
Urinate asked 10/3, 2022 at 20:56

5

Solved

Is there a way to get rid of tick labels altogether when creating an array of subplots in Matplotlib? I am currently needing to specify each plot based on the row and column of a larger data set to...
Matless asked 4/8, 2014 at 17:18

3

Solved

I want to plot a barplot of some data with some x-axis labels but so far I just keep running into the same problem, as the axis scaling is completely off limits and therefore my labels are wrongly ...
Pedroza asked 27/11, 2011 at 13:4

1

Solved

Let's say I create a plotly figure like this: x = [['A','A','B','B'], ['X','Y','X','Y']] y = [1,2,3,2] fig = go.Figure() fig.add_bar(x=x, y=y) fig.show() I get this: I want to rotate the secondar...
Overage asked 1/2, 2022 at 14:50

6

I am trying to solve the below issue for last couple of days but still not able to resolve it. I have searched lots of forums but all in vain. *Little bit of history: My code was working well in t...
Indictable asked 25/11, 2013 at 0:48

© 2022 - 2025 — McMap. All rights reserved.