到目前为止我已经尝试过以下代码:
# Import to handle plotting
import seaborn as sns
# Import pyplot, figures inline, set style, plot pairplot
import matplotlib.pyplot as plt
# Make the figure space
fig = plt.figure(figsize=(2,4))
gs = fig.add_gridspec(2, 4)
ax1 = fig.add_subplot(gs[0, :])
ax2 = fig.add_subplot(gs[1, :])
# Load the example car crash dataset
tips = sns.load_dataset("tips")
# Plot the frequency counts grouped by time
sns.catplot(x='sex', hue='smoker',
kind='count',
col='time',
data=tips,
ax=ax1)
# View the data
sns.catplot(x='sex', y='total_bill', hue='smoker',
kind='violin',
col='time',
split='True',
cut=0,
bw=0.25,
scale='area', …Run Code Online (Sandbox Code Playgroud) 总之,我想要一个模板类,它可以有一个 std::tuple 或整数类型的类成员。
我想做的事情的本质粘贴在下面。
#include <tuple>
#include <vector>
#include <string>
template<typename T>
class DATA
{
public:
T value;
};
template<typename... T>
class DATA
{
public:
std::tuple<T...> value;
};
int main(int argc, char *argv[])
{
DATA<int> d1;
d1.value = 10;
DATA<int, std::string, std::vector<int>> d2;
std::get<0>( d2.value ) = 100;
std::get<1>( d2.value ) = "Hello World";
std::get<2>( d2.value ).push_back(1);
std::get<2>( d2.value ).push_back(2);
std::get<2>( d2.value ).push_back(3);
return 0;
}
Run Code Online (Sandbox Code Playgroud)