Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Axis labels not showing up

I am having trouble with my axis, labels, etc. showing up in my plot. All I get are the data points.

My plot is showing up like this:

plot

My code is this

plot(Corr_SIMPIN_clean$PlanSum ~ Corr_SIMPIN_clean$POMP_Score_Flanker, xlab = "PlanSum", ylab = "POMP Score Flanker")

My data looks like this:

data

like image 568
user5162881 Avatar asked Mar 08 '16 20:03

user5162881


People also ask

Why are axis labels not showing in Excel?

Right click on the chart, select "Format Chart Area..." from the pop up menu. A sidebar will appear on the right side of the screen. On the sidebar, click on "CHART OPTIONS" and select "Horizontal (Category) Axis" from the drop down menu. Four icons will appear below the menu bar.

How do I get my axis labels back in Excel?

Click the chart, and then click the Chart Layout tab. Under Labels, click Axis Titles, point to the axis that you want to add titles to, and then click the option that you want. Select the text in the Axis Title box, and then type an axis title.


1 Answers

As stated, i believe you have something weird at the graphical parameters; do you have any par() lines after opening the graphical device? Try using device.off() or graphics.off() and then start the graphic device again.

If not, i advice you to try this:

  • Add xaxs="i",yaxs="i",xaxt="n",yaxt="n"to your plot parameters.
  • Add this two lines after the plot command:

    axis(1, xaxp=c(minx,maxx,stepsx))

    axis(2, yaxp=c(miny,maxy,stepsy))

Where minx, maxx, miny, maxy are the boundaries of the axis and stepx, stepyare the number of steps between markers in the axis.

like image 65
Ghost Avatar answered Oct 19 '22 14:10

Ghost