Skip to content

Histogram margin & Plot caption#24

Open
Pavel-Sedlacek wants to merge 3 commits into
skoudmar:graphsfrom
Pavel-Sedlacek:plot-ui
Open

Histogram margin & Plot caption#24
Pavel-Sedlacek wants to merge 3 commits into
skoudmar:graphsfrom
Pavel-Sedlacek:plot-ui

Conversation

@Pavel-Sedlacek
Copy link
Copy Markdown
Contributor

This PR introduces a 10% margin (5% of the bin width on each side) between histogram bins to separate between adjacent bins with identical heights.

It also adds a CLI flag to enable plot captions. The caption is derived from the name stored in the results file for each graph element:

  • Node: /node element (where element type can be e.g. Callback(Subscriber(/topic)))
  • Edge: /topic (/source_node -> /target_node)

Comment thread src/plotting/mod.rs
>,
scaled_axis_descriptor: &[ScaledAxisDescriptor; 2],
sizes: &PlotSpacing,
fmap: impl Fn(T) -> i64,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary to add an extra parameter here. If I see correctly, you convert the i64 value to f64 in SiPrefix::express_value() anyway. So use f64 everywhere and avoid these extra conversions forth and back.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that converting at almost every call is bad, but I also believe that there is no way to convert LogCoord<i64> to LogCoord<f64> without it showing 0.1 or 0.01 if the actual data range is not large enough.

image

Comment thread src/extract/mod.rs Outdated
element_id: i64,
property: &AnalysisProperty,
) -> color_eyre::eyre::Result<PlottableData> {
) -> color_eyre::eyre::Result<(String, PlottableData)> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer changing PlottableData to be a struct and adding a title field into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants