Questions tagged [x-axis]

For questions related to the formatting of the x-axis in a plot

332 questions
0
votes
1 answer

Multiple Data Frame Plot Custom Legend and X Axis Breaks?

The data is 1965-2019 Renewable Energy Vs Alternative Energy Sources. I have two issues I am trying to tackle here. I would like to 1) Add a custom legend signifying the two colors and naming them accordingly. 2) I want to know if there is an easy…
Samh200
  • 13
  • 3
0
votes
1 answer

Plotting dates on the x-axis in a tkinter canvas with matplotlib

There are many solutions for plotting dates on the x-axis with matplotlib. A good one I found here (3.Answer) [Plotting dates on the x-axis with Python's matplotlib - Stack Overflow] **How do I get the graph with the x-axis and data displayed in a…
weki
  • 1
  • 1
0
votes
1 answer

How can I get dates on the x axis in my animated line chart?

I borrowed some code from the web for this line chart animation, but unfortunately it came with some sort of count() for the x axis rather than the dates that I am importing from Yahoo. I'm new to this, can you help? I get an okay plot, but I would…
gerald
  • 420
  • 2
  • 8
0
votes
1 answer

why is ggplot2 geom_col misreading discrete x axis labels as continuous?

Aim: plot a column chart representing concentration values at discrete sites Problem: the 14 site labels are numeric, so I think ggplot2 is assuming continuous data and adding spaces for what it sees as 'missing numbers'. I only want 14 columns with…
Paul
  • 5
  • 3
0
votes
1 answer

how to translate x-axis plot code to ggplot code in R

I'm having troubles using this idea with ggplot2 axis(1, at=1:6, lab=c("Art", "Basic", "Comp", "Day", "Est", "Fin")) how can I do this with the ggplot2 package? Thank you!
math_ist
  • 69
  • 5
0
votes
1 answer

How to scale x-axis in matplotlib with unequal gaps

I have to following table: and I create the following graph with this code: code: plt.plot(new[201], label='201') plt.genend() plt.show() graph: how can I scale the x-axis NOT to be with equal gaps? for example, if I use the same data in excel I…
RvN
  • 1
0
votes
1 answer

Find x-axis location to make an element move

I'm trying to make an element move backward on the X axis when the user presses "a". However, I don't know how to make it move farther every time the users presses that key :(. I'm new to JS document.addEventListener("keypress", function (e) { let…
Teodora
  • 3
  • 1
0
votes
0 answers

Matplotlib - Histogram - First bin doesn't start at the beginning of X-axis

In this post i'm not talking about how bins are calculated. I want that the first bin gets located at the beginning of the X-axis. In other words : I want that the first bin gets located where is the Y-axis Here is my source code : import…
floupinette
  • 150
  • 11
0
votes
1 answer

Matplotlib Plot X, Y Line Plot Multiple Columns Fixed X Axis

I'm trying to plot a df with the x axis forced to 12, 1, 2 for (Dec, Jan, Feb) and I cannot see how to do this. Matplot keeps wanting to plot the x axis in the 1,2,12 order. My DF (analogs_re) partial columns for the example looks like this: …
user2100039
  • 1,280
  • 2
  • 16
  • 31
0
votes
0 answers

Changing Date Format X-Axis Matplotlib

I have a plot that I need to change the date format along the x-axis to 'YYYY-mm' format. The plot looks like this: The code looks like this - import matplotlib.dates as mdates import datetime from matplotlib.dates import DateFormatter def…
user2100039
  • 1,280
  • 2
  • 16
  • 31
0
votes
1 answer

Axis labels for two variables in ggplot?

I have a ggplot with three variables: office, level, and gender. The plot should be factored by office and level and shows the levels and gender representation for each office. I have no problem faceting the plot the way I want, but I haven't been…
craigh
  • 25
  • 5
0
votes
0 answers

how to rearrange scatter x-axis plot using seaborn

How to change the x-axis to order 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ?enter image description here here, I attached my current display of scatter plot.
0
votes
0 answers

How to change the order of categorical x-axis in interaction plot in python?

So I am generating the interaction plot by using statsmodels package. Here in the figure below, you can see my current result. I would like to have first "Block" and second "Alternating" in my x-axis. I was wondering how to make this change? Here is…
0
votes
0 answers

To change values across x & y axis in a plotting

I want to change values across the x- & y-axes in a plot. import numpy as np import pandas as pd from pandas import Series,DataFrame import matplotlib.pyplot as plt from matplotlib import rcParams rcParams['figure.figsize'] = 7,6 x =…
0
votes
1 answer

ggplot2: two x-axis tics (year and month) and labels on two lines

I have this plot command: pdx_1990s_plot <- ggplot(pdx_disc_1990s, aes(year+(mon/12), vol)) + geom_bar(stat='identity', color='blue', fill='#0387fc', position='dodge') + theme_classic() + theme(plot.title = element_text(hjust = 0.5, face…
Rich Shepard
  • 109
  • 2
  • 10