You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unfortunatly my understanding of Rust types is not good enough to solve this.
I would like to have an application, that takes as arguments whether the axis should be log scale.
Therefore I would like to build_cartesion2d and then still apply some general other options.
E.g. like the code below. I fail to find a way to not duplicate the code below that match statement.
As said, this might be totally because of my lack of knowledge.
Thanks a lot!
Andreas
If you are asking usage question, please go to discussion tab. Thanks!
let x_scale = x_dim_min..x_dim_max;
let y_scale = y_dim_min..y_dim_max;
let mut grid = match (opt.logx, opt.logy)
{
(true, true) => chart.build_cartesian_2d(x_scale.log_scale(), y_scale.log_scale()),
(true, false) => chart.build_cartesian_2d(x_scale.log_scale(), y_scale),
(false, true) => chart.build_cartesian_2d(x_scale, y_scale.log_scale()),
(false, false) => chart.build_cartesian_2d(x_scale, y_scale),
};
grid.configure_mesh()
.disable_x_mesh()
.bold_line_style(WHITE.mix(0.3))
.y_desc(ydesc)
.x_desc(xdesc)
.label_style(("sans-serif", 24u32))
.axis_desc_style(("sans-serif", 22u32));
grid.draw().expect("draw");
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
unfortunatly my understanding of Rust types is not good enough to solve this.
I would like to have an application, that takes as arguments whether the axis should be log scale.
Therefore I would like to build_cartesion2d and then still apply some general other options.
E.g. like the code below. I fail to find a way to not duplicate the code below that match statement.
As said, this might be totally because of my lack of knowledge.
Thanks a lot!
Andreas
Beta Was this translation helpful? Give feedback.
All reactions