- Related Questions & Answers
- How to X-axis labels to the top of the plot using ggplot2 in R?
- How to display raise to the power on X-axis in base R plot?
- How to create the stacked bar plot using ggplot2 in R with labels on the plot?
- How to rotate X-axis tick labels in Pandas bar plot?
- How to display tick marks on upper as well as right side of the plot using ggplot2 in R?
- How to move the Y-axis ticks from the left side of the plot to the right side in matplotlib?
- How to create a plot with tick marks between X-axis labels in base R?
- How to plot data against specific dates on the X-axis using Matplotlib?
- Show the origin axis (x,y) in Matplotlib plot
- How to change the adjustment of the plot title using ggplot2 to align it above the Y-axis labels in R?
- How to change the color of the axis, ticks and labels for a plot in matplotlib?
- How to change the automatic sorting of X-axis of a bar plot using ggplot2 in R?
- How to create a plot in base R with dates sequence on X-axis?
- How to change the axes labels using plot function in R?
- Adjusting the spacing between the edge of the plot and the X-axis in Matplotlib

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

By default, the X−axis labels are plotted on the bottom−axis of the plot and that is referred to as the first axis of axis 1, the second axis is the axis on the left−side, the third axis is the axis on the upper side of the plot, and the fourth axis is on the right−side of the plot. If we want to plot the X−axis labels on the upper−side of the plot then we can use xaxt="n" inside the plot function then define axis for upper−side using axis(3) with semi−colon.

x<−1:10 plot(x,xaxt="n");axis(3)

y<−rnorm(10,1,0.8) plot(y,xaxt="n");axis(3)

y<−rnorm(10,1,0.8) z<−rpois(10,5) plot(y,z,xaxt="n");axis(3)

Advertisements