MCPcopy Create free account
hub / github.com/cpmech/plotpy / set_title

Method set_title

src/plot.rs:438–442  ·  view source on GitHub ↗

Adds a title to the plot or sub-plot # Notes 1. Single quotation marks are replaced by the [UTF-8 Right Single Quotation Mark](https://www.compart.com/en/unicode/U+2019) because the Python script already uses the single quotation mark. Note that cannot use the raw notation `"""` because otherwise some TeX formula wouldn't work; notably the ones starting with `\v` such as `\varepsilon`

(&mut self, title: &str)

Source from the content-addressed store, hash-verified

436 /// because the Python script already uses the single quotation mark. Note that cannot use the raw notation `"""` because
437 /// otherwise some TeX formula wouldn't work; notably the ones starting with `\v` such as `\varepsilon`
438 pub fn set_title(&mut self, title: &str) -> &mut Self {
439 let t = title.replace("'", "’");
440 write!(&mut self.buffer, "plt.title(r'{}')\n", t).unwrap();
441 self
442 }
443
444 /// Adds a title to all sub-plots
445 ///

Callers 12

test_inset_axes_1Function · 0.45
test_barplot_2Function · 0.45
test_barplot_3Function · 0.45
test_barplot_4Function · 0.45
test_boxplot_1Function · 0.45
test_boxplot_2Function · 0.45
test_boxplot_3Function · 0.45
test_plotFunction · 0.45
test_plot_handles_quotesFunction · 0.45
test_plot_subplotsFunction · 0.45

Calls

no outgoing calls

Tested by 12

test_inset_axes_1Function · 0.36
test_barplot_2Function · 0.36
test_barplot_3Function · 0.36
test_barplot_4Function · 0.36
test_boxplot_1Function · 0.36
test_boxplot_2Function · 0.36
test_boxplot_3Function · 0.36
test_plotFunction · 0.36
test_plot_handles_quotesFunction · 0.36
test_plot_subplotsFunction · 0.36