我有一个rmarkdown演示文稿(ioslides)有3张幻灯片,流程图在DiagrammeR美人鱼中工作.保存为.Rmd的以下文件可以重现该示例(至少在我的机器中,希望您也是如此):
---
title: "Untitled"
author: "author"
date: "28 de enero de 2018"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
require(DiagrammeR)
```
## DiagrammeR's mermaid
It's not producing consistent results in slides when using line breaks.
```{r flow}
mermaid("
graph LR
C(CLIENTES <br>Clients) --> D[Doctors]
U(USUARIOS <br>Users <br>Patients <br>Nurses) --> D
D --> S(SALIDAS <br>Medicines <br>Surgery)
style C fill: #f5f5dc
style D fill: #4682b4
style U fill: #ffe4c4
")
```
## Second attempt
```{r flow2}
mermaid("
graph …Run Code Online (Sandbox Code Playgroud) 我试图控制 matplotlib 散点图上的 y 轴顺序,但我所拥有的数据中 x 轴和 y 轴的顺序导致绘图显示不正确。
下面是一些代码来说明问题以及提出解决方案的次优尝试。
import pandas as pd
from numpy import random
import matplotlib.pyplot as plt
# make some fake data
axes = ['a', 'b', 'c', 'd']
pairs = pd.DataFrame([(x, y) for x in axes for y in axes], columns=['x', 'y'])
pairs['value'] = random.randint(100, size=16) + 100
# remove the diagonal
pairs_nodiag = pairs[pairs['x'] != pairs['y']]
# zero the values for the diagonal
pairs_diag = pairs.copy()
pairs_diag.loc[pairs_diag['x'] == pairs_diag['y'], 'value'] = 0
fig, ax …Run Code Online (Sandbox Code Playgroud)