R语言绘图——数据可视化ggplot2 介绍和主要的参数

Python015

R语言绘图——数据可视化ggplot2 介绍和主要的参数,第1张

R 有几种用于制作图形的系统,但 ggplot2 是最优雅和最通用的系统之一。与大多数其他图形包不同,ggplot2 具有基于图形语法的底层语法,它允许您通过组合独立组件来组合图形。如果想要更加了解ggplot2,请阅读 ggplot2: Elegant Graphics for Data Analysis ,可以从 https://ggplot2-book.org/getting-started.html 学习本书

所有的图都由数据data,想要可视化的信息,映射mapping(即数据变量如何映射到美学属性的描述)组成

1. 图层(layers) 是几何元素和统计变换的集合。几何对象,简称 geoms ,代表你在图中实际看到的东西:点、线、多边形等等。 统计转换,简称 stats ,总结数据:例如,装箱和计数观察,以创建一个直方图,或拟合一个线性模型。

2. Scales 将数据空间中的值映射到美学空间中的值。这包括颜色、形状和大小的使用。Scale还绘制图例和轴,这使得从图中读取原始数据值成为可能(反向映射)。

3. 坐标(coords) 或坐标系统描述如何将数据坐标映射到图形的平面。它还提供了轴和网格线来帮助读取图形。我们通常使用笛卡尔坐标系,但也可以使用其他一些坐标系,包括极坐标和地图投影。

4. 刻面(facet) 指定如何拆分数据子集并将其显示为小倍数。这也被称为条件反射或网格/格子。

5. theme 控制更精细的显示点,如字体大小和背景颜色。

ggplot2有许多参数,可根据需求自行选取,具体参数详情可见 https://ggplot2.tidyverse.org/reference/index.html

基础绘图:由 ggplot(data,aes(x,y))+geom_ 开始,至少包含这三个组件,可以通过"+"不断的添加layers, scales, coords和facets。

Geoms :几何对象,通常,您将使用geom_函数创建层,以下为常用的图形:

geom_bar() :直方图,条形图

geom_boxplot() :box图

geom_density() :平滑密度估计曲线

geom_dotplot() :点图

geom_point() :点图

geom_violin() :小提琴图

aes(),颜色、大小、形状和其他审美属性

要向绘图添加其他变量,我们可以使用其他美学,如颜色、形状和大小。

按照属性定义

它们的工作方式与 x 和 y 相同,aes():

aes(displ, hwy, colour = class) #按照某个属性着色

aes(displ, hwy, shape = drv) #按照某个属性定义

aes(displ, hwy, size = cyl) #按照某个属性定义

整体自定义

geom_xxx(colour =自定义颜色)

geom_xxx(shape=形状编号)

geom_xxx(size =编号大小定义 0-10)

注意根据需求按照aes()还是geom进行添加属性

以下为R语言中各shape形状编号

scale控制如何将数据值转换为视觉属性的细节。

labs()和lims() 是对标签和限制进行最常见调整。

labs() ,主要对图形进行调整,注释等

labs()括号内参数:title主标题,subtitle副标题,caption右下角描述,tag左上角

xlab() ,x轴命名

ylab() ,y轴命名

ggtitle() ,标题

lims()

xlim() , xlim(a,b) 限制坐标(a,b)

ylim() , ylim(a,b) 限制坐标(a,b)

scale_alpha() 透明度尺度

scale_shape() , 搭配aes(shape=某个属性)使用

参数:name ,solid =T/F是否填充

scale_size()搭配aes(size=某个属性)使用

参数:name,range =c(0, 10)

1.适用于发散和定性的数据

a. scale_colour_brewer() ,scale_colour_brewer(palette =" "),scale_colour_brewer(palette ="Green ")

palette来自RcolorBrewer包,所有面板:

b. scale_colour_manual()

scale_colour_manual(values=c( )) 可以 自定义颜色 ,常用的参数

values可直接定义颜色,但是建议使用命名向量,例如

values=c("8" = "red", "4" = "blue", "6" = "darkgreen", "10" = "orange")

PS:注意在aes(colour=factor()),一定要把因素转换为factor型,否则无效

2.适用于连续的值,渐变颜色

a. scale_colour_gradient()

scale_colour_gradient (low =" ",high=" "),根据值大小定义颜色,创建两个颜色梯度(低-高),

b. scale_colour_gradient2()

scale_colour_gradient2(low = " ",mid = " ",high = " ")创建一个发散的颜色梯度(低-中-高)

c. scale_colour_gradientn()

创建一个n色渐变,scale_colour_gradientn(colours =许多R语言中的颜色面板),

默认坐标系是笛卡尔 coord_cartesian()

一般不会修改

facet_grid() ,在网格中布置面板

facet_grid(rows = vars() ) cols或rows = vars(因素),图形按列或行分割

facet_wrap()

facet_wrap(vars( ), ncol =n) , ncol或者nrow,分为多少行多少列

theme_bw() ,可以覆盖所有主题,背景变为白色,我们在文章中所用的图片大都需要该背景。

或者用 theme_classic() ,同时去除了网格线

theme() ,修改主题的组件,里面涉及多个参数,根据需求调整

常见参数:

legend.position,图例的位置,包括 "left" 左, "right" 右, "bottom" 下, "top" 上和"none",不显示

R has several systems for making graphs, but ggplot2 is one of the most elegant and most versatile. ggplot2 implements the grammar of graphics, a coherent system for describing and building graphs. With ggplot2, you can do more faster by learning one system and applying it in many places.

tidyverse 包含了 ggplot2, readr, dplyr, tibble, purrr 等工具包,可以一站式完成数据读写、数据处理和数据可视化的任务。

You only need to install a package once, but you need to reload it every time you start a new session.

If we need to be explicit about where a function (or dataset) comes from, we’ll use the special form package::function(). For example, ggplot2::ggplot() tells you explicitly that we’re using the ggplot() function from the ggplot2 package.

在开始前,先介绍这部分用到的案例信息:

Do cars with big engines use more fuel than cars with small engines? You probably already have an answer, but try to make your answer precise. What does the relationship between engine size and fuel efficiency look like? Is it positive? Negative? Linear? Nonlinear?

mpg是ggplot2包内置的数据集:

其中,int 整型,dbl 双精度,chr 字符型,

以上变量的含义:

Wilkinson(2005)提出语法规则→Wickham(2009)编写ggplot2

Wilkinson在2005年提出一套用来描述所有统计图形深层特性的语法规则:一张统计图形就是从数据到几何对象(geometric object,缩写为geom,如点、线、条形等)的图形属性(aesthetic attributes,缩写为aes,如颜色、形状、大小等)的一个映射,此外,图形中还可能包含数据的统计变换(statistical system,缩写为stats),最后绘制在某个特定的坐标系(coordinate system,缩写为coord)中,而分面(facet,指将绘图窗口划分为若干个子窗口)则可以用来生成数据不同子集的图形(毛里里求斯)。

ggplot2包由Hadley Wickham(2009a)编写,提供了一种基于Wilkinson(2005)所述图形语法的图形系统,Wickham(2009b)还对该语法进行了扩展。ggplot2包的目标是提供一个全面的、基于语法的、连贯一致的图形生成系统,允许用户创建新颖的、有创新性的数据可视化图形。该方法的力量已经使得ggplot2成为使用R进行数据可视化的重要工具(攀董)。

ggplot2有以下特点(黄宝臣):

以下是ggplot2图层函数的示意图:

基础的命令:

With ggplot2, you begin a plot with the function ggplot() . ggplot() creates a coordinate system that you can add layers to. The first argument of ggplot() is the dataset to use in the graph. So ggplot(data = mpg) creates an empty graph.

You complete your graph by adding one or more layers to ggplot() . The function geom_point() adds a layer of points to your plot, which creates a scatterplot. ggplot2 comes with many geom functions that each add a different type of layer to a plot.

Each geom function in ggplot2 takes a mapping argument. This defines how variables in your dataset are mapped to visual properties. The mapping argument is always paired with aes(), and the x and y arguments of aes() specify which variables to map to the x and y axes. ggplot2 looks for the mapped variables in the data argument, in this case, mpg .

接下来我们从<MAPPINGS>映射关系拓展开来~

很容易看出刚刚绘制的图形中有一些异常值,如何来分析呢?

Let’s hypothesize that the cars are hybrids. One way to test this hypothesis is to look at the class value for each car. The class variable of the mpg dataset classifies cars into groups such as compact, midsize, and SUV. If the outlying points are hybrids, they should be classified as compact cars or, perhaps, subcompact cars (keep in mind that this data was collected before hybrid trucks and SUVs became popular).

You can add a third variable, like class, to a two dimensional scatterplot by mapping it to an aesthetic.An aesthetic is a visual property of the objects in your plot. Aesthetics include things like the size, the shape, or the color of your points. You can display a point (like the one below) in different ways by changing the values of its aesthetic properties. Since we already use the word “value” to describe data, let’s use the word “level” to describe aesthetic properties. Here we change the levels of a point’s size, shape, and color to make the point small, triangular, or blue:

注意:The shape palette can deal with a maximum of 6 discrete values because more than 6 becomes difficult to discriminateyou have 7. Consider specifying shapes manually if you must have them.

按颜色

You can convey information about your data by mapping the aesthetics in your plot to the variables in your dataset. For example, you can map the colors of your points to the class variable to reveal the class of each car.

To map an aesthetic to a variable, associate the name of the aesthetic to the name of the variable inside aes() . ggplot2 will automatically assign a unique level of the aesthetic (here a unique color) to each unique value of the variable, a process known as scaling. ggplot2 will also add a legend that explains which levels correspond to which values.

注意:如果在mapping外部设置color时,只是改变了所有点的颜色,并没有做映射。

为什么会是两座车?

The colors reveal that many of the unusual points are two-seater cars. These cars don’t seem like hybrids, and are, in fact, sports cars! Sports cars have large engines like SUVs and pickup trucks, but small bodies like midsize and compact cars, which improves their gas mileage. In hindsight, these cars were unlikely to be hybrids since they have large engines.

按大小

In the above example, we mapped class to the color aesthetic, but we could have mapped class to the size aesthetic in the same way. In this case, the exact size of each point would reveal its class affiliation. We get a warning here, because mapping an unordered variable (class) to an ordered aesthetic (size) is not a good idea.

除了按颜色、形状等分类外,我们还可以有如下的操作:

What does the stroke aesthetic do? What shapes does it work with? (Hint: use ?geom_point )

What happens if you map an aesthetic to something other than a variable name, like aes(colour = displ <5) ? Note, you’ll also need to specify x and y.

One way to add additional variables is with aesthetics. Another way, particularly useful for categorical variables, is to split your plot into facets , subplots that each display one subset of the data.

To facet your plot by a single variable , use facet_wrap() . The first argument of facet_wrap() should be a formula, which you create with ~ followed by a variable name (here “formula” is the name of a data structure in R, not a synonym for “equation”). The variable that you pass to facet_wrap() should be discrete.

To facet your plot on the combination of two variables , add facet_grid() to your plot call. The first argument of facet_grid() is also a formula. This time the formula should contain two variable names separated by a ~ .

If you prefer to not facet in the rows or columns dimension , use a . instead of a variable name.

分面有什么好处

What are the advantages to using faceting instead of the colour aesthetic? What are the disadvantages? How might the balance change if you had a larger dataset?

当变量较多的时候,图形属性颜色区分度不高,不能很好区分各个样本点,而分面可以,但是分面后不同面上的点之间不好比较,所以 变量少容易区分时可以用图形属性映射,多的时候颜色大小等不容易区分可以考虑分面 (TidyFridy笔记本)。

单变量和双变量的分面

Read ·?facet_wrap·. What does nrow do? What does ncol do? What other options control the layout of the individual panels? Why doesn’t ·facet_grid()· have nrow and ncol arguments?

nrow 和 ncol 控制分面子图的排版,facet_grid() 对应 x 方向和 y 方向的分面图个数是确定的,所有不用设置。

A geom is the geometrical object that a plot uses to represent data. People often describe plots by the type of geom that the plot uses. For example, bar charts use bar geoms, line charts use line geoms, boxplots use boxplot geoms, and so on. Scatterplots break the trendthey use the point geom.

To change the geom in your plot, change the geom function that you add to ggplot() . For instance, to make the plots above, you can use this code:

调整线段形式

Every geom function in ggplot2 takes a mapping argument. However, not every aesthetic works with every geom. You could set the shape of a point, but you couldn’t set the “shape” of a line. On the other hand, you could set the linetype of a line. geom_smooth() will draw a different line, with a different linetype, for each unique value of the variable that you map to linetype.

Here geom_smooth() separates the cars into three lines based on their drv value, which describes a car’s drivetrain. One line describes all of the points with a 4 value, one line describes all of the points with an f value, and one line describes all of the points with an r value. Here, 4 stands for four-wheel drive, f for front-wheel drive, and r for rear-wheel drive.

对比group和color

Many geoms, like geom_smooth() , use a single geometric object to display multiple rows of data. For these geoms, you can set the group aesthetic to a categorical variable to draw multiple objects. ggplot2 will draw a separate object for each unique value of the grouping variable. In practice, ggplot2 will automatically group the data for these geoms whenever you map an aesthetic to a discrete variable (as in the linetype example). It is convenient to rely on this feature because the group aesthetic by itself does not add a legend or distinguishing features to the geoms.

多几何对象

To display multiple geoms in the same plot , add multiple geom functions to ggplot():

全局映射

This, however, introduces some duplication in our code. Imagine if you wanted to change the y-axis to display cty instead of hwy. You’d need to change the variable in two places, and you might forget to update one. You can avoid this type of repetition by passing a set of mappings to ggplot(). ggplot2 will treat these mappings as global mappings that apply to each geom in the graph . In other words, this code will produce the same plot as the previous code:

If you place mappings in a geom function, ggplot2 will treat them as local mappings for the layer. It will use these mappings to extend or overwrite the global mappings for that layer only . This makes it possible to display different aesthetics in different layers.

You can use the same idea to specify different data for each layer . Here, our smooth line displays just a subset of the mpg dataset, the subcompact cars. The local data argument in geom_smooth() overrides the global data argument in ggplot() for that layer only.

se 代表是否在图形中显示标准差

filter(mpg, class == "subcompact") 只选择车型为subcompact的汽车

Next, let’s take a look at a bar chart. Bar charts seem simple, but they are interesting because they reveal something subtle about plots. Consider a basic bar chart, as drawn with geom_bar() . The following chart displays the total number of diamonds in the diamonds dataset, grouped by cut . The diamonds dataset comes in ggplot2 and contains information about ~54,000 diamonds, including the price , carat , color , clarity , and cut of each diamond. The chart shows that more diamonds are available with high quality cuts than with low quality cuts.

On the x-axis, the chart displays cut , a variable from diamonds . On the y-axis, it displays count, but count is not a variable in diamonds ! Where does count come from? Many graphs, like scatterplots, plot the raw values of your dataset. Other graphs, like bar charts, calculate new values to plot:

The algorithm used to calculate new values for a graph is called a stat, short for statistical transformation. The figure below describes how this process works with geom_bar().

默认属性

You can learn which stat a geom uses by inspecting the default value for the stat argument. For example, ?geom_bar shows that the default value for stat is “count”, which means that geom_bar() uses stat _count() . stat_count() is documented on the same page as geom_bar() , and if you scroll down you can find a section called “Computed variables”. That describes how it computes two new variables: count and prop.

You can generally use geoms and stats interchangeably. For example, you can recreate the previous plot using stat_count() instead of geom_bar() :

This works because every geom has a default statand every stat has a default geom . This means that you can typically use geoms without worrying about the underlying statistical transformation. There are three reasons you might need to use a stat explicitly :

注:group = 1 将所有的数据看作一组,如果不设置,所有的 bar 将是等高的

ggplot2 provides over 20 stats for you to use. Each stat is a function, so you can get help in the usual way, e.g. ?stat_bin . To see a complete list of stats, try the ggplot2 cheatsheet.

单变量:边缘和填充

There’s one more piece of magic associated with bar charts. You can colour a bar chart using either the colour aesthetic, or, more usefully, fill :

The stacking is performed automatically by the position adjustment specified by the position argument. If you don’t want a stacked bar chart, you can use one of three other options: "identity", "dodge" or "fill" .

以上是自动调整,接下来以条形图为例来看刊 ggplot 支持的几种位置调整方式。

1. position = 'identity'

position = "identity" will place each object exactly where it falls in the context of the graph. This is not very useful for bars, because it overlaps them. To see that overlapping we either need to make the bars slightly transparent by setting alpha to a small value, or completely transparent by setting fill = NA .

The identity position adjustment is more useful for 2d geoms, like points, where it is the default.

2. position = "fill"

position = "fill" works like stacking, but makes each set of stacked bars the same height. This makes it easier to compare proportions across groups.

3. position = "dodge"

position = "dodge" places overlapping objects directly beside one another. This makes it easier to compare individual values.

**There’s one other type of adjustment that’s not useful for bar charts, but it can be very useful for scatterplots. **Recall our first scatterplot. Did you notice that the plot displays only 126 points, even though there are 234 observations in the dataset?

原因是有些点被覆盖了,可以用 geom_point(position = 'jitter') 来缓解

Coordinate systems are probably the **most complicated part of ggplot2. **The default coordinate system is the Cartesian coordinate system where the x and y positions act independently to determine the location of each point. There are a number of other coordinate systems that are occasionally helpful.

参考资料:

R for Data Science

每天 5 分钟,轻轻松松上手 R 语言(一)

如何使用 ggplot2 ?

R-可视化 | ggplot2框架与主要函数

ggplot2 专题分析

由对称相关面的各向异性生长而产生的生物成因晶体的复杂形态

文章出处: Emanuel M. Avrahami, Lothar Houben, Lior Aram, Assaf Gal. Complex morphologies of biogenic crystals emerge from anisotropic growth of symmetry-related facets. Science 2022 , 376 , 312-316.

摘要: 引导晶体生长到复杂的形态是具有挑战性的,因为晶体往往采用热力学稳定的形态。然而,许多生物形成的晶体具有复杂的形态,例如颗石,单细胞藻类产生的微方解石晶体阵列。颗石晶体的复杂形态被假设是由许多晶体面形成的,通过有机分子和生长晶体之间的精细调节的相互作用稳定下来。利用电子断层扫描技术,作者在三个维度上检查了多个阶段的颗石生长。作者发现晶体只表达一组对称相关的晶体面,这些面生长差异,产生高度各向异性的形状。形态手性的产生是由于晶体沿着这些切面的特定边缘定位。作者的发现表明,生长速率操纵足以产生复杂的晶体形态。

对晶体材料纳米尺度形貌的控制与它们的物理性质和潜在的应用有关。然而,晶体晶格固有的热力学性质决定了一种强烈的趋向于特定的低能量面,从而产生了特征形状(习惯)。相比之下,许多生物进化出了在非常简单的材料和环境条件下形成复杂的分层组织的晶体结构的能力。在这种生物矿化过程中,晶体的形态、成核位置、取向以及最终的形态都受到严格的控制。颗石[由称为颗石藻的单细胞藻类形成的微米大小的方解石(碳酸钙)鳞片]是生物控制晶体形态发生的一个主要例子。每个颗石由晶体亚单位组成,具有复杂的种特异性形态。颗石是在细胞内与一个特殊的囊泡形成的,称为颗石囊泡,钙和碳酸盐被输送到其中。在颗石囊泡内,晶体成核并围绕有机基底的边缘生长。

颗石结构的一个共同特征是晶体单元的交替排列,正如在V/R模型中确定的那样。根据该模型,两个单元类型组成一个颗石(一个V单元和一个R单元),具有方解石 c 轴相对于基底的垂直或径向方向。这些单元最初具有伪菱面体形态,与热力学稳定的{104}方解石菱面体非常相似。尽管如此,在完成后,它们的形态是高度复杂的,显示出各种表面,明显偏离简单的菱形习惯。

关于颗石形态发生的共识观点依赖于生物分子作为“雕塑家的工具箱”。其基本原理是,与生长晶体的特定立体化学相互作用,使这些生物分子的过程偏离稳定的热力学路径,进入局部动力学的最小值,从而产生潜在的无限形态。据推测,晶体成核是由基底外延的结果,晶体生长产生各种类型的晶体面,由“定制的”生物分子稳定。也有人认为,与手性有机改性剂的立体定向相互作用诱发方解石的手性习惯。

为了阐明颗石晶体的形态生长,作者研究了 Calcidiscus leptoporus 的大颗石,其具有特有的双屏蔽超微结构(图1A)。为了建立一个颗石生长的时间表,作者建立了一个提取细胞内颗石(ICCs)的程序。首先,在短暂的酸暴露下去除活跃钙化细胞的细胞外颗石。接下来,用低渗溶液使细胞破裂,从而释放ICCs。通过调节低渗溶液的pH值和化学性质,作者确保晶体形态不受影响。因此,ICCs充当晶体动态发展的“时间快照”。

提取的ICCs的扫描电子显微镜(SEM)图像(图1)显示了从100-200 nm的小菱形体到完全形成的手性颗石的中间形态演化序列。结构的整体手性甚至在初始单元的排列中也很明显,这类似于方解石的各向同性菱形习惯(图1E和1I)。观测到两种不同的晶体表面类型:(i) 具有直边的平面,表征两个盾牌的远侧(图1紫色箭头),(ii) 弯曲和光滑的表面,表征两个盾牌和茎区域的近侧(图1绿色箭头)。

作者使用高分辨率电子断层扫描技术在三维和不同生长阶段研究这两个单元的晶体形态。利用扫描透射电子显微镜(STEM)采集不同生长阶段的ICCs的层析图像,采用高角度环形暗场(HAADF)探测器进行三维重建。对早期生长阶段的颗石的三维分析显示,所有的晶体单元都暴露出扁平的晶体面(图2)。这些表面之间的二面角及其边缘之间的角与已知的{104}方解石菱面体的角一致,这表明只有这些稳定的晶体面显示出来。

作者观测到R单元位于它们的锐边,沿着颗石环的圆周排列(图2A),这种安排与其它物种的观测结果一致。这很有趣,有两个原因:(i) 由于几何上的考虑,与传统的V/R模型不同,将{104}菱形对齐在其锐边加强了晶体 c 轴的子径向方向,打破了径向对称,并向突出结构传递手性(图2A,青色箭头);(ii) 它挑战了外延的概念,因为晶体应该具有平行于成核表面(即基底)的小面,而不是边缘。尽管在V单元中不太清楚(初始晶体的菱形不那么明显),作者也看到晶体的 c 轴具有亚垂直倾斜,这是菱形在钝角边缘上定向的结果(图2B)。由于作者的数据缺乏导致这种晶体定向调控机制的信息,基底作为成核表面的作用仍然是一个开放的问题。

为了将形态信息与晶体的晶体学结构联系起来,作者从环形暗场(ADF) STEM中分析相邻的R单元,并结合扫描纳米束电子衍射(NBED),后者采用从光束光栅所经过的每一点收集衍射模式。分析证实了各单元之间的相对倾斜,以及每个 c 轴相对于颗石周长的子径向偏移(图2C-2E)。这些对早期ICCs的分析使作者能够将“经典”的V/R模型(该模型以 c 轴方向为中心,是手性的)细化为一个更精确的基于锐/钝边的晶体菱形的晶体学表征。这一观点将两个晶体学特征合并为一个基本结构,其中倾斜的轴和手性的超结构都起源于晶体的初始定位。

为了了解颗石晶体生长和互锁的方式,作者详细分析了单个晶体单元的形态。对5个颗石进行部分分割,反映了适合断层扫描的颗石生长阶段(图3)。推导出的“时间线”揭示了几个关键方面:(i) 两种单元类型都表现出从相对各向同性的菱形向成熟各向异性晶体的转变(图3A和3B);(ii) 两种单元类型的特征面在整个生长过程中都呈现结晶性,而一些区域(茎区、盾的近侧和相邻晶体之间的界面)保持弯曲形态(图3C);(iii) 整个晶体生长过程中类晶面之间的二面角均对应{104}习惯。

这条时间线显示了初始晶体的等效{104}晶面以各向异性的方式发展,从而产生了尺寸非常不同的成熟的{104}晶面(图3D和3E)。这些观测结果表明,晶体的复杂形态不是由各种类型的晶体面造成的,而是由化学等效{104}晶面的生长差异造成的。

观测到晶体生长只伴随着{104}晶面的表达式(图3),并且这些{104}晶面以不同的速度生长,提出了一个关键的问题,即导致这种对称性破坏的因素。这个难题来自于所有六个{104}晶面的对称性和化学等价性,这样就没有一个晶面具有与其它晶面不同的内在生长速率(即钙和碳酸盐对任何特定的{104}晶面不应该显示出关联或离解偏向)。

为了理解这些化学等效面的各向异性是如何出现的,作者分析了特定面的生长模式。观测到两种截然不同的模式:(i) 单个晶体单元的对称相关晶面对的微分生长[例如(-114)和(104)晶面,图4A],其中一个面比它的相对面和/或相邻面生长得更快,导致一个各向异性图案;(ii) 面对相同环境的两种不同单元类型(R和V单元)的面生长差异(图4B)。在后一种情况下,晶面首先出现在彼此的水平上,但最终V单位不断超过R单位(图4B)。这两个例子都显示了两个化学上相同的方面,但由于某种原因,它们的生长速度不同。

在均匀溶液中,等效晶面的各向异性生长与其相同的生长动力学是不相容的。然而,在原子尺度上,方解石的生长通过锐角和钝角两个阶段进行,每个阶段都有不同的生长动力学。因此,晶体生长环境中的纳米尺度不均匀性会导致晶体生长的各向异性。在几种颗石藻中,结晶发生在极端限制条件下,晶体和囊泡膜之间只有几十纳米的距离。这种限制直接表现在晶体形态上,如非晶体表面,这是由颗石囊泡的划界膜造成的生长的物理模块。作者提出,通过在颗石囊泡创建一个分级的纳米环境,该限域环境也直接影响晶体生长。例如,由囊泡膜上的离子转运体产生的局部离子通量可能产生浓度梯度。它仍然是必要的特征,化学和结构,细胞环境及其与生长晶体的相互作用。

图4C-4E,说明了这种浓度梯度如何在原子尺度上不同地影响生长步骤,导致等效面不同的生长动力学,从而导致各向异性生长。例如,当晶体的一个面比另一个面经历更高的离子浓度时,它将更快地向离子源生长(图4C)。更有趣的是,当不同晶体的两个相邻面呈现出不同的几何形状,它们的原子步向离子梯度(图4D),导致其中一个晶体生长更快。在纳米级梯度(图4E)的存在下,阶梯取向的差异打破了相邻晶体之间的对称性,并可以解释它们的各向异性生长。

颗石晶体生长不是一个过程,源于晶体生长的多重操纵;相反,它取决于方解石及其菱形几何结构的稳定习性所产生的各种后果。这种生长机制可以通过离子传输的速率和位置来控制,而不是通过“定制”修改特定的晶体面。作者可以想象颗石组装的初始条件的改变(例如单位取向、单位间距、离子通量方向或生长过程中的膜位置)如何显著影响最终的颗石形态。