简体   繁体   中英

Remove only axis values in plot Julia

In R you can use this to remove the axis values:

x <- 1:20
y <- runif(20)
plot(x, y, axes=FALSE, frame.plot=TRUE)
Axis(side=1, labels=FALSE)
Axis(side=2, labels=FALSE)

Output:

在此处输入图像描述

As mentioned in this answer , you can remove the axis values and tick marks like this:

import Pkg
Pkg.add("Plots")
using Plots
# generating vectors
# x-axis
x = 1:10
 
# y-axis
y = rand(10)
 
# simple plotting
plot(x, y, ticks = false)

Output:

在此处输入图像描述

Is it possible to only remove the values of the axis while keeping the tick marks like in the R example?

Try

plot(x, y, formatter=(_...) -> "")  #or:
plot(x, y, formatter=Returns(""))

formatter (and xformatter , yformatter ) specifies a function which formats the axis labels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM