考虑:
ListPlot[Range[10],
Background -> Gray,
PlotLabel -> "I don`t want the background here !"]
Run Code Online (Sandbox Code Playgroud)

有没有办法让背景仅适用于实际的绘图区?
不在轴上,不在标签后面.那么基本上就是那个矩形{{0,0},{10,10}}?
编辑:我们可以使用PolarListPlot做同样的事情吗?
使用Mathematica在笛卡尔图上使用Sjoerd解决方案 到极坐标直方图:
dalist = {{21, 22}, {26, 13}, {32, 17}, {31, 11}, {30, 9},
{25,12}, {12, 16}, {18, 20}, {13, 23}, {19, 21},
{14, 16}, {14,22}, {18, 22}, {10, 22}, {17, 23}}
ScreenCenter = {20, 15}
ListPolarPlot[{ArcTan[##],EuclideanDistance[##]} & @@@ (# - ScreenCenter & /@ dalist),
PolarAxes -> True, PolarGridLines -> Automatic, Joined -> False,
PolarTicks -> {"Degrees", Automatic},
BaseStyle -> …Run Code Online (Sandbox Code Playgroud) 可能重复:
将密度曲线拟合为R中的直方图
我试图在R中的直方图上添加最佳拟合法线.现在,我有以下内容:
x<-table[table$position==1,]$rt
hist(x,breaks=length(x))
Run Code Online (Sandbox Code Playgroud)
现在我想在这个图上绘制一条正态曲线,允许偏斜和峰度.我怎样才能做到这一点?这就是我的曲线:

正如标题所说,我正在尝试将网格函数的2变量切片(例如.jpg)保存为子图.我想使用.m文件执行此操作,因为我有许多图表要生成.我已经弄清楚如何在他们自己的数字上绘制视图,但我不能让他们正确地绘制成图中的子图.说明我的意思:
以下是各个图的输出:
3D网格:3D MATLAB网格图
XY视图:XY MATLAB网格视图
YZ视图:YZ MATLAB网格视图
XZ视图:XZ MATLAB网格视图
这是我的绘图代码(不工作):
%Ambiguity Surface
fid = figure(fnum);
axes1 = axes('Parent',fid);
view(axes1,[-62.5 28]);
grid(axes1,'on');
hold(axes1,'all');
msh = mesh(taux,fdy,z,'Parent',axes1);
xlabel ('Delay - seconds');
ylabel ('Doppler - Hz');
zlabel ('Ambiguity function (Normalized Magnitude-Squared)');
fname = strcat(name,' (Ambiguity Function z(\tau;F_d))');
title(fname);
cb = colorbar('peer',axes1);
set(get(cb,'ylabel'),'String','Magnitude-Squared (dB)');
hold off;
printFig(fid,fnum,sname)
fnum = fnum + 1;
%Ambiguity Slices
fid = figure(fnum);
hold all;
subplot(2,1,1);
axes1 = axes();
grid(axes1,'on');
view(axes1,[90 0]);
msh = mesh(taux,fdy,z); …Run Code Online (Sandbox Code Playgroud)
我想创建类似极点/零点的极点/零点图.它用于显示IIR和FIR滤波器属性,如稳定性,类型......
我的问题是:如何为两个轴设置相同的比例(不是范围)?
我使用ScatterPlot作为图表.
JFreeChart chart = ChartFactory.createScatterPlot("Pole/zero plot", // chart
// title
"real", // x axis label
"imaginary", // y axis label
result, // data
PlotOrientation.VERTICAL, true, // include legend
true, // tooltips
false // urls
);
XYPlot plot = (XYPlot) chart.getPlot();
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.black);
plot.setDomainGridlinePaint(Color.black);
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseItemLabelsVisible(true);
renderer.setBaseItemLabelsVisible(true, true);
plot.setDomainCrosshairVisible(true);
plot.setDomainCrosshairLockedOnData(true);
plot.setRangeCrosshairVisible(true);
plot.setRangeCrosshairLockedOnData(true);
float dash1[] = { 10.0f };
XYShapeAnnotation unitCircle = new XYShapeAnnotation(
new Ellipse2D.Double(-1, -1, 2, 2), new BasicStroke(1.0f,
BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, …Run Code Online (Sandbox Code Playgroud) 我可以在命令行上尝试使用4x4绘图,但在下面的代码中不能使用for -loop和png元素.我很沮丧问题是什么,我现在已经试着理解这个时间而且无法前进.
只是$ R CMD Sweave paper.Rnw,$ pdflatex paper.tex和$ evince paper.pdf你复制后的代码下面paper.Rnw -file - ,你会得到一个1x1的情节,而不是4×4的情节.为什么?
$ mkdir Pictures
$ mkdir Data
$ cd Data
$ wget https://noppa.aalto.fi/noppa/kurssi/mat-2.3128/harjoitustyot/Mat-2_3128_data_2.xls
$ cd ..
$ cat paper.Rnw
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{graphicx}
\begin{document}
<<echo=FALSE>>=
library(gdata)
f<-read.xls('./Data/Mat-2_3128_data_2.xls')
for(i in 1:ncol(f))
{
png(paste('./Pictures/CO',i,'.png',sep =''))
par(mfrow=c(2,2))
plot(pacf(na.omit(f[,i])), main=paste('Pacf', i))
plot(acf(na.omit(f[,i])), main=paste('Acf', i))
plot(na.omit(f[,i]), main=paste('Data', i), type='l')
}
@
\subsection{Time-serie C1}
\includegraphics{./Pictures/CO1.png}
\subsection{Time-serie C2}
\includegraphics{./Pictures/CO2.png}
\subsection{Time-serie C3}
\includegraphics{./Pictures/CO3.png}
\subsection{Time-serie C4}
\includegraphics{./Pictures/CO4.png}
\subsection{Time-serie C5} …Run Code Online (Sandbox Code Playgroud) 我在R中制作一个情节我想在y轴上的特定点(比方说,alpha)上出现一个符号.我的x轴使用对数刻度,所以我不认为我可以使用xy坐标(0,alpha)来绘制点(我可能是错的).
我尝试过这样的事情:
W.range <- range(W)
Z.range <- range(Z1, Z2)
# Draw Empty Graph
plot(W.range, Z.range, type="n", log="x")
# First Curve
lines(W, Z1, type="l", lty=1, lwd=1.5, col=1)
# Second Curve
lines(W, Z2, type="l", lty=2, lwd=1.5, col=2)
# Plot Single Point on vertical axis at level alpha (for some constant alpha)
points(x=0, y=alpha, pch=1, col=1)
Run Code Online (Sandbox Code Playgroud)
但是,我得到与x = 0坐标有关的错误.建议吗?一如既往,我很欣赏这些建议.
我试图在ggplot2中制作堆积线图,其中正值堆叠在x轴上方,负值堆叠在x轴下方.我已经成功地分别堆叠了每种线型,但是无法在一个图上同时存在这两种线型.我正在寻找一些关于如何做到这一点的帮助,无论是通过叠加情节还是在单个情节上做一些有创意的事情.
我下面的代码使用了一个带有堆叠geom_line图的简单ggplot."类型"的一半是关于时间的正值,而"类型"的另一半都是负值.
p <- ggplot(dataForm, aes(x=Time,y=Value,group=Type),colour=factor(Type))
p + geom_line(aes(fill = Type),position = "stack")
Run Code Online (Sandbox Code Playgroud)
我尝试了另外一种单独指定正值和负值的方法,但没有成功:
p <- ggplot(dataForm, aes(x=Time,y=Value,group=Type),colour=factor(Type))
p + geom_line(data = data1,aes(fill = Type),position = "stack")
p + geom_line(data = data1,aes(fill = Type),position = "stack")
Run Code Online (Sandbox Code Playgroud)
任何有关如何做到这一点的建议都非常感谢.谢谢.
我在Python中有很长的代码,所以我不能在这里写出来.无论如何,问题是我正在使用semilogx命令在代码中绘制一个函数,一切正常.但是,如果我切换到plot命令,我收到此错误:
TypeError:'bool'对象不可调用
您认为可能导致问题的原因是什么?
似乎我在代码中使用plot命令的任何地方都会得到相同的错误.我尝试绘制我在代码中使用的第一个变量:
f=loadtxt(folder_out+"stars/stars"+str(output)+".txt",skiprows=2)
ids=f[:,0]
mass_star=f[:,1] # mass in Msun
x=f[:,2]
y=f[:,3]
z=f[:,4]
age=f[:,5] # age in Myr
plot(x,y,'.')
Run Code Online (Sandbox Code Playgroud)
最后一行给了我错误.我确定我从文件中读取了变量,它们具有相同的维度.
这是数据:
111, 3
122, 4
155, 3
192, 5
11, 9
123, 10
120, 23
Run Code Online (Sandbox Code Playgroud)
现在我怎么能用这两组数据绘制直方图matplotlib.请帮忙.
我想用histfit从图中得到密度曲线的方程.
我看到使用ksdensity函数可以得到一个点向量.这是最好的方法吗?
plot ×10
r ×4
histogram ×3
matlab ×2
matplotlib ×2
python ×2
3d ×1
axes ×1
background ×1
boolean ×1
ggplot2 ×1
java ×1
jfreechart ×1
mesh ×1
overlay ×1
probability ×1
stacked ×1
subplot ×1
sweave ×1