直方图的大小,在R图中具有正态分布

时间:2016-12-12 16:09:09

标签: r

我使用以下代码生成具有所属正态分布的直方图

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
	<div class="col col-sm-12">
		<div class="container"><br>
			<form class="form form-inline form-multiline" role="form">
				<div class="form-group">
					<div class="input-group">
						<input type="text" class="form-control" placeholder="Pesquisar" aria-describedby="basic-addon2">
						<span class="input-group-addon" id="basic-addon2"><i class="glyphicon glyphicon-search"></i></span>
					</div>
				</div>
				<div class="form-group">
					<input type="button" class="btn btn-default" value="Filtros">
				</div>
				<div class="col col-sm-12">
					<div class="col col-sm-4">
						<ul>
							<h4>Situação</h4>
							<li>Útumos incluídos</li>
							<li>Todos</li>
							<li>Ativos</li>
							<li>Excluídos</li>
							<li>Inativos</li>
						</ul>
					</div>
					<div class="col col-sm-4">
						<ul>
							<h4>Tipo de cadastro</h4>
							<li>Cliente</li>
							<li>Fornecedor</li>
							<li>Transportador</li>
							<li>Vendedor</li>
							<li>Sem tipo definido</li>
						</ul>
					</div>
					<div class="col col-sm-4">
						<h4>Outras opções de pesquisa</h4>
						<div class="form-holder">
							<div class="form-group col-sm-12">
								<label>Vendedor</label>
								<input type="text" class="form-control">
							</div>
							<div class="form-group col-sm-8">
								<label>Município</label>
								<input type="text" class="form-control">
							</div>
							<div class="form-group col-sm-4">
								<label>Estado</label>
								<select name="" id="" class="form-control">
									<option value="">Select</option>
								</select>
							</div>
							<div class="form-group col-sm-12">
								<label>Telefone / Celular</label>
								<input type="text" class="form-control">
							</div>
							<h4>Prox. Visita</h4>
							<div class="form-group col-sm-6">
								<label>De:</label>
								<div class="input-group date" id="datetimepicker1">
									<input type="text" class="form-control">
									<span class="input-group-addon">
										<span class="glyphicon glyphicon-calendar"></span>
									</span>
								</div>
							</div>
							<div class="form-group col-sm-6">
								<label>Até:</label>
								<div class="input-group date" id="datetimepicker1">
									<input type="text" class="form-control">
									<span class="input-group-addon">
										<span class="glyphicon glyphicon-calendar"></span>
									</span>
								</div>
							</div>
							<h4>Sem compras no período</h4>
							<div class="form-group col-sm-6">
							<label>De:</label>
								<div class="input-group date" id="datetimepicker1">
									<input type="text" class="form-control">
									<span class="input-group-addon">
										<span class="glyphicon glyphicon-calendar"></span>
									</span>
								</div>
							</div>
							<div class="form-group col-sm-6">
								<label>Até:</label>
								<div class="input-group date" id="datetimepicker1">
									<input type="text" class="form-control">
									<span class="input-group-addon">
										<span class="glyphicon glyphicon-calendar"></span>
									</span>
								</div>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

如何减小绘图的大小,以便能够在绘图中看到整个正态分布?

plot

1 个答案:

答案 0 :(得分:0)

const ref = firebase.database().ref('bookmarks')
    .orderByChild('date')
    .startAt(date.end)
    .endAt(date.start)
    .limitToLast(10)

来自http://statmethods.net

边距和图表大小

  

您可以使用以下参数控制边距大小。

df   <- data.frame(rnorm(1000), rnorm(1000))
h    <- hist(df[,1], breaks=10, density=10, col="lightgray", xlab="Accuracy", main="Overall")    
xfit <- seq(min(df[,1]),max(df[,1]),length=40) 
yfit <- dnorm(xfit,mean=mean(df[,1]),sd=sd(df[,1])) 
yfit <- yfit*diff(h$mids[1:2])*length(df[,1]) 
par()$pin
par(pin=c(2,2))
lines(xfit, yfit, col="black", lwd=2)