MFMessageComposeViewController显示消息体突出显示进行编辑(MFMessageComposeViewController show with message body highlighted for editing)
我们可以像这样创建和显示文本作曲家:
let controller = MFMessageComposeViewController() controller.body = messageText controller.recipients = numbers controller.messageComposeDelegate = self self.present(controller, animated: true, completion: nil)
是否有可能提供一个MFMessageComposeViewController与
body
突出显示,以便用户可以开始输入以输入新消息,如果他们不喜欢我们提供的默认消息?我查看了文档,但没有找到任何选项。
We can create and show a text composer like so:
let controller = MFMessageComposeViewController() controller.body = messageText controller.recipients = numbers controller.messageComposeDelegate = self self.present(controller, animated: true, completion: nil)
Is it possible to present an MFMessageComposeViewController with
body
highlighted so that the user can just start typing to enter a new message if they do not like the default message we have provided?I looked through the docs but did not find any options for this.
原文:https://stackoverflow.com/questions/41988788
最满意答案
您正在使用数据框图函数创建新图形。 您应该传递要绘制第二个图的轴。 一种方法是使用
gca
来获取当前轴。以下应该工作(虽然没有测试):
plt.figure(figsize=(10,7)) img=imread('California.png') plt.imshow(img,zorder=0,extent=[housing['longitude'].min(),housing['longitude'].max(),housing['latitude'].min(),housing['latitude'].max()]) ax = plt.gca() housing.plot(x='longitude', y='latitude', kind='scatter', alpha=0.4, s= housing['population']/100, label='population', ax=ax, c= 'median_house_value', cmap=plt.get_cmap('jet'), colorbar=True, zorder=5) plt.legend() plt.show()
编辑:使用
imshow
的extent
参数以及经度和纬度数据的最小值和最大值将正确缩放图像。You are creating a new figure by using the dataframe plot function. You should pass the axes on which you want to draw your second plot. One way is to use
gca
to get the current axis.The following should work (not tested though):
plt.figure(figsize=(10,7)) img=imread('California.png') plt.imshow(img,zorder=0,extent=[housing['longitude'].min(),housing['longitude'].max(),housing['latitude'].min(),housing['latitude'].max()]) ax = plt.gca() housing.plot(x='longitude', y='latitude', kind='scatter', alpha=0.4, s= housing['population']/100, label='population', ax=ax, c= 'median_house_value', cmap=plt.get_cmap('jet'), colorbar=True, zorder=5) plt.legend() plt.show()
EDIT: using the
extent
parameter ofimshow
with the minimum and maximum values of your longitude and latitude data will scale the image correctly.
相关问答
更多-
首先,您需要对数据进行密度估算。 根据您选择的方法,可以获得不同的结果 。 假设你想要进行高斯密度估计 ,基于scipy.stats.gaussian_kde的例子,你可以得到密度高度: def density_estimation(m1, m2): X, Y = np.mgrid[xmin:xmax:100j, ymin:ymax:100j] positions = np.vstack ...
-
散点图移动标签(Scatter plot move labels)[2022-04-06]
您可以使用xytext参数来调整文本位置: plt.annotate(text[i],xy=(x[i],y[i]),xytext=(x[i]+10,y[i]+10), ha='right') 在这里,我将10添加到您的xy位置。 欲了解更多,你可以查看这里的建议: https : //matplotlib.org/users/annotations_intro.html You can use the xytext parameter to adjust the text position: plt.an ... -
您正在使用数据框图函数创建新图形。 您应该传递要绘制第二个图的轴。 一种方法是使用gca来获取当前轴。 以下应该工作(虽然没有测试): plt.figure(figsize=(10,7)) img=imread('California.png') plt.imshow(img,zorder=0,extent=[housing['longitude'].min(),housing['longitude'].max(),housing['latitude'].min(),housing['latitude'] ...
-
我想你想做这样的事情: w = .2 bins = np.linspace(-4, 4, 11, endpoint=True) fig, ax = plt.subplots() for j in range(1, 15): tt = randn(50) nn, _bins = np.histogram(tt, bins) # don't use scatter unless you need to change the size or color of the markers ...
-
您将图像视图添加到子图中 getPlotChildren().add(iv1); 您可能不需要在重写的layoutPlotChildren()方法中执行此操作:仅在构造函数中执行一次就足够了: class SuperScatterChart extends ScatterChart
{ private final ImageView iv1 ; public SuperScatterChart(NumberAxis xAxis, NumberAxis yA ... -
结果有两个原因。 1 - imshow()函数逐个像素地绘制,因此我必须将x和y乘以各自的轴分辨率,即(2048 x 1025) 2 - 我也有经纬度困惑,结果是x和拉特是y So there are two reasons it turns out. 1 - The imshow() function plots pixel by pixel so I had to multiply the x an y by there respective axis resolutions namely (2048 ...
-
我没有成功改变系列顺序,导致分散数据出现在一行之后。 即使图例的顺序发生变化,绘图顺序似乎也不会受到影响。 为了使您的线显示在散点图数据的前面,您需要将线放在辅助轴上,然后确保辅助轴的最小/最大值与主轴相同。 如果您不想看到辅助轴,请将“标签位置”设置为“无”。 I have not had success with changing series order causing scatter data to appear behind a line. Even though the order of the ...
-
如何使用Scatter Plot highchart绘制下图?(How to draw following graph using Scatter Plot highchart?)[2023-02-10]
使用renderer.path绘制一条线。 您可以在加载事件上绘制线条并在重绘事件上重绘它。 events: { load: function() { var point = this.series[0].points[0], { plotX: x, plotY: y } = point; point.path = this.renderer.path() .add(point.ser ... -
散点图和箱线图叠加(Scatter plot and boxplot overlay)[2023-10-11]
将color=放在geom_point()的aes()中,并将其从ggplot() aes()删除。 如果你把color=放在ggplot()那么它会影响所有的geoms。 你也可以考虑使用位置闪避来分离点数。 使用mtcars数据作为OP的示例未提供数据。 ggplot(mtcars,aes(factor(cyl),mpg))+geom_boxplot()+ geom_point(aes(color=factor(am)),position=position_dodge(width=0.5)) Pu ... -
你可以让Matlab用KML格式写出来在Google Earth中显示。 这里有一些关于在KML中绘制路径点的文档: 链接 You could have Matlab write this out in KML format to display in Google Earth. Here's some documentation on plotting points of a path in KML: link