Movatterモバイル変換


[0]ホーム

URL:


Skip to contents

Axis scale for continuous data

scale-continuous.Rd

Axis scale for continuous data

Usage

v_scale_x_continuous(vc,  name=NULL,  breaks=NULL,  pretty=TRUE,  labels=NULL,  labels_tooltip=labels,  zero=NULL,  min=NULL,  max=NULL,...,  position="bottom")v_scale_y_continuous(vc,  name=NULL,  breaks=NULL,  pretty=TRUE,  labels=NULL,  labels_tooltip=labels,  zero=NULL,  min=NULL,  max=NULL,...,  position="left")v_scale_x_log(vc,  name=NULL,  breaks=NULL,  pretty=TRUE,  labels=NULL,  labels_tooltip=labels,  zero=NULL,  min=NULL,  max=NULL,...,  position="bottom")v_scale_y_log(vc,  name=NULL,  breaks=NULL,  pretty=TRUE,  labels=NULL,  labels_tooltip=labels,  zero=NULL,  min=NULL,  max=NULL,...,  position="left")

Arguments

vc

An htmlwidget created withvchart() or specific chart's type function.

name

Title for the axis.

breaks

One of:

  • A singlenumeric value giving the number of breaks.

  • A numeric vector of positions.

pretty

Usepretty() to identify breaks ifbreaks is a single numeric value.

labels, labels_tooltip

The format to be applied on numeric in the labels/tooltip. Either:

  • A single character indicating the D3 format.

  • AJS function, such asformat_num_d3().

zero

Force axis to start at 0.

min

Minimum value on the axis.

max

Maximum value on the axis.

...

Additional parameters for the axis.

position

Position of the axis.

Value

Avchart()htmlwidget object.

Examples

library(vchartr)# Add a title to the axisvchart(top_generation)%>%v_bar(aes(country,electricity_generation))%>%v_scale_y_continuous(name="Electricity generation")
vchart(subset(world_electricity,type=="total"))%>%v_bar(aes(year,generation, fill=source))%>%v_scale_y_continuous(name="Electricity generation")
# Specify number of breaksvchart(top_generation)%>%v_bar(aes(country,electricity_generation))%>%v_scale_y_continuous(breaks=10)
# Specify breaks positionvchart(top_generation)%>%v_bar(aes(country,electricity_generation))%>%v_scale_y_continuous(breaks=c(0,5000,10000))
# Format labelsvchart(top_generation)%>%v_bar(aes(country,electricity_generation))%>%v_scale_y_continuous(labels="~s")
# Format labels with optionsvchart(top_generation)%>%v_bar(aes(country,electricity_generation))%>%v_scale_y_continuous(labels=format_num_d3(",", suffix=" TWh", locale="fr-FR"))
vchart(subset(world_electricity,type=="total"))%>%v_bar(aes(year,generation, fill=source))%>%v_scale_y_continuous(labels=format_num_d3(",", suffix=" TWh", locale="fr-FR"))

[8]ページ先頭

©2009-2025 Movatter.jp