Plot
Plotting functions for visualizing proteomics data from Qtable
.
The functions in this module generate a wide range of plots, including heatmaps, PCA plots, volcano plots, and histograms, to analyze and compare expression values, missingness, contaminants, and other features in proteomics datasets. The plots are designed to work with the Qtable class as input, which provides structured access to proteomics data and experimental design information.
Users can customize plot styles via the set_active_style
function, which allows
applying style sheets from the msreport library or those available in matplotlib.
Functions:
Name | Description |
---|---|
expression_comparison |
Generates an expression comparison plot for two experiments. |
pvalue_histogram |
Generates p-value histograms for one or multiple experiment comparisons. |
volcano_ma |
Generates a volcano and an MA plot for the comparison of two experiments. |
experiment_ratios |
Figure to compare the similarity of expression values between experiments. |
replicate_ratios |
Figure to compare the similarity of expression values between replicates. |
expression_clustermap |
Plot sample expression values as a hierarchically-clustered heatmap. |
sample_pca |
Figure to compare sample similarities with a principle component analysis. |
contaminants |
A bar plot that displays relative contaminant amounts (iBAQ) per sample. |
missing_values_horizontal |
Horizontal bar plot to analyze the completeness of quantification. |
missing_values_vertical |
Vertical bar plot to analyze the completeness of quantification. |
sample_correlation |
Generates a pair-wise correlation matrix of samples 'Expression' values. |
sample_intensities |
Figure to compare the overall quantitative similarity of samples. |
set_active_style |
Set the active plotting style for the msreport.plot submodule. |
set_dpi |
Changes the default dots per inch settings for matplotlib plots. |
expression_comparison
expression_comparison(
qtable: Qtable,
experiment_pair: list[str],
comparison_tag: str = " vs ",
plot_average_expression: bool = False,
special_entries: Optional[list[str]] = None,
special_proteins: Optional[list[str]] = None,
annotation_column: str = "Gene name",
exclude_invalid: bool = True,
) -> tuple[Figure, list[Axes]]
Generates an expression comparison plot for two experiments.
The subplot in the middle displays the average expression of the two experiments on the y-axis and the log fold change on the x-axis. The subplots on the left and right display entries with only missing values in one of the two experiments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
experiment_pair
|
list[str]
|
The names of the two experiments that will be compared, experiments must be present in qtable.design. |
required |
comparison_tag
|
str
|
String used in comparison columns to separate a pair of experiments; default " vs ", which corresponds to the MsReport convention. |
' vs '
|
plot_average_expression
|
bool
|
If True plot average expression instead of maxium expression. Default False. |
False
|
special_entries
|
Optional[list[str]]
|
Optional, allows to specify a list of entries from the
|
None
|
special_proteins
|
Optional[list[str]]
|
This argument is deprecated, use 'special_entries' instead. |
None
|
annotation_column
|
str
|
Column used for labeling the points of special entries in the
scatter plot. Default "Gene name". If the 'annotation_column' is not present
in the |
'Gene name'
|
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
Raises:
Type | Description |
---|---|
ValueError
|
If the "Expression" and "Events" columns for the specified experiments are missing in the Qtable. |
Returns:
Type | Description |
---|---|
Figure
|
A matplotlib Figure objects and a list of three Axes objects containing the |
list[Axes]
|
expression comparison plots. |
Source code in msreport\plot\comparison.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
|
pvalue_histogram
pvalue_histogram(
qtable: Qtable,
pvalue_tag: str = "P-value",
comparison_tag: str = " vs ",
experiment_pairs: Optional[
Sequence[Iterable[str]]
] = None,
exclude_invalid: bool = True,
) -> tuple[Figure, list[Axes]]
Generates p-value histograms for one or multiple experiment comparisons.
Histograms are generated with 20 bins of size 0.05. The p-value distribution of each experiment comparison is shown with a separate subplot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
pvalue_tag
|
str
|
String used for matching the pvalue columns; default "P-value", which corresponds to the MsReport convention. |
'P-value'
|
comparison_tag
|
str
|
String used in comparison columns to separate a pair of experiments; default " vs ", which corresponds to the MsReport convention. |
' vs '
|
experiment_pairs
|
Optional[Sequence[Iterable[str]]]
|
Optional, list of experiment pairs that will be used for plotting. For each experiment pair a p-value column must exists that follows the format f"{pvalue_tag} {experiment_1}{comparison_tag}{experiment_2}". If None, all experiment comparisons that are found in qtable.data are used. |
None
|
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
Raises:
Type | Description |
---|---|
ValueError
|
If no experiment pairs are found in the Qtable for the provided p-value tag and comparison tag or if any of the provided experiment pairs does not exist in the Qtable. |
Returns:
Type | Description |
---|---|
tuple[Figure, list[Axes]]
|
A matplotlib Figure and a list of Axes objects, containing the p-value plots. |
Source code in msreport\plot\comparison.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
|
volcano_ma
volcano_ma(
qtable: Qtable,
experiment_pair: Iterable[str],
comparison_tag: str = " vs ",
pvalue_tag: str = "P-value",
special_entries: Optional[list[str]] = None,
special_proteins: Optional[list[str]] = None,
annotation_column: str = "Gene name",
exclude_invalid: bool = True,
) -> tuple[Figure, list[Axes]]
Generates a volcano and an MA plot for the comparison of two experiments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
experiment_pair
|
Iterable[str]
|
The names of the two experiments that will be compared, experiments must be present in qtable.design. |
required |
comparison_tag
|
str
|
String used in comparison columns to separate a pair of experiments; default " vs ", which corresponds to the MsReport convention. |
' vs '
|
pvalue_tag
|
str
|
String used for matching the pvalue columns; default "P-value", which corresponds to the MsReport convention. |
'P-value'
|
special_entries
|
Optional[list[str]]
|
Optional, allows to specify a list of entries from the
|
None
|
special_proteins
|
Optional[list[str]]
|
This argument is deprecated, use 'special_entries' instead. |
None
|
annotation_column
|
str
|
Column used for labeling the points of special entries in the
scatter plot. Default "Gene name". If the 'annotation_column' is not present
in the |
'Gene name'
|
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
Raises:
Type | Description |
---|---|
ValueError
|
If the 'pvalue_tag', "Average expression" or "Ratio [log2]" column is missing in the Qtable for the specified experiment_pair. |
Returns:
Type | Description |
---|---|
Figure
|
A matplotlib Figure object and a list of two Axes objects containing the volcano |
list[Axes]
|
and the MA plot. |
Source code in msreport\plot\comparison.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
experiment_ratios
experiment_ratios(
qtable: Qtable,
experiments: Optional[str] = None,
exclude_invalid: bool = True,
ylim: Sequence[float] = (-2, 2),
) -> tuple[Figure, list[Axes]]
Figure to compare the similarity of expression values between experiments.
Intended to evaluate the bulk distribution of expression values after normalization. For each experiment a subplot is generated, which displays the distribution of log2 ratios to a pseudo reference experiment as a density plot. The pseudo reference values are calculated as the average intensity values of all experiments. Only rows with quantitative values in all experiment are considered.
Requires "Events experiment" columns and that average experiment expression values
are calculated. This can be achieved by calling
msreport.analyze.analyze_missingness(qtable: Qtable)
and
msreport.analyze.calculate_experiment_means(qtable: Qtable)
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
experiments
|
Optional[str]
|
Optional, list of experiments that will be displayed. If None, all
experiments from |
None
|
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
ylim
|
Sequence[float]
|
Specifies the displayed range for the log2 ratios on the y-axis. Default is from -2 to 2. |
(-2, 2)
|
Raises:
Type | Description |
---|---|
ValueError
|
If only one experiment is specified in the |
Returns:
Type | Description |
---|---|
tuple[Figure, list[Axes]]
|
A matplotlib Figure and a list of Axes objects, containing the comparison plots. |
Source code in msreport\plot\distribution.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
replicate_ratios
replicate_ratios(
qtable: Qtable,
exclude_invalid: bool = True,
xlim: Iterable[float] = (-2, 2),
) -> tuple[Figure, list[Axes]]
Figure to compare the similarity of expression values between replicates.
Displays the distribution of pair-wise log2 ratios between samples of the same experiment. Comparisons of the same experiment are placed in the same row. Requires log2 transformed expression values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
xlim
|
Iterable[float]
|
Specifies the displayed range for the log2 ratios on the x-axis. Default is from -2 to 2. |
(-2, 2)
|
Returns:
Type | Description |
---|---|
tuple[Figure, list[Axes]]
|
A matplotlib Figure and a list of Axes objects, containing the comparison plots. |
Source code in msreport\plot\distribution.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
expression_clustermap
expression_clustermap(
qtable: Qtable,
exclude_invalid: bool = True,
remove_imputation: bool = True,
mean_center: bool = False,
cluster_samples: bool = True,
cluster_method: str = "average",
) -> ClusterGrid
Plot sample expression values as a hierarchically-clustered heatmap.
By default missing and imputed values are assigned an intensity value of 0 to perform the clustering. Once clustering is done, these values are removed from the heatmap, making them appear white.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
remove_imputation
|
bool
|
If True, imputed values are set to 0 before clustering. Defaults to True. |
True
|
mean_center
|
bool
|
If True, the data is mean-centered before clustering. Defaults to False. |
False
|
cluster_samples
|
bool
|
If True, sample order is determined by hierarchical clustering. Otherwise, the order is determined by the order of samples in the qtable design. Defaults to True. |
True
|
cluster_method
|
str
|
Linkage method to use for calculating clusters. See
|
'average'
|
Raises:
Type | Description |
---|---|
ValueError
|
If less than two samples are present in the qtable. |
Returns:
Type | Description |
---|---|
ClusterGrid
|
A seaborn ClusterGrid instance. Note that ClusterGrid has a |
ClusterGrid
|
that can be used for saving the figure. |
Source code in msreport\plot\multivariate.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
|
sample_pca
sample_pca(
qtable: Qtable,
tag: str = "Expression",
pc_x: str = "PC1",
pc_y: str = "PC2",
exclude_invalid: bool = True,
) -> tuple[Figure, list[Axes]]
Figure to compare sample similarities with a principle component analysis.
On the left subplots two PCA components of log2 transformed, mean centered intensity values are shown. On the right subplot the explained variance of the principle components is display as barplots.
It is possible to use intensity columns that are either log-transformed or not. The intensity values undergo an automatic evaluation to determine if they are already in log-space, and if necessary, they are transformed accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
tag
|
str
|
A string that is used to extract intensity containing columns. Default "Expression". |
'Expression'
|
pc_x
|
str
|
Principle component to plot on x-axis of the scatter plot, default "PC1". The number of calculated principal components is equal to the number of samples. |
'PC1'
|
pc_y
|
str
|
Principle component to plot on y-axis of the scatter plot, default "PC2". The number of calculated principal components is equal to the number of samples. |
'PC2'
|
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
Returns:
Type | Description |
---|---|
tuple[Figure, list[Axes]]
|
A matplotlib Figure and a list of Axes objects, containing the PCA plots. |
Source code in msreport\plot\multivariate.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
contaminants
A bar plot that displays relative contaminant amounts (iBAQ) per sample.
Requires "iBAQ intensity" columns for each sample, and a "Potential contaminant" column to identify the potential contaminant entries.
The relative iBAQ values are calculated as: sum of contaminant iBAQ intensities / sum of all iBAQ intensities * 100
It is possible to use intensity columns that are either log-transformed or not. The intensity values undergo an automatic evaluation to determine if they are already in log-space, and if necessary, they are transformed accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
tag
|
str
|
A string that is used to extract iBAQ intensity containing columns. Default "iBAQ intensity". |
'iBAQ intensity'
|
Raises:
Type | Description |
---|---|
ValueError
|
If the "Potential contaminant" column is missing in the Qtable data. If the Qtable does not contain any columns for the specified 'tag'. |
Returns:
Type | Description |
---|---|
tuple[Figure, Axes]
|
A matplotlib Figure and an Axes object, containing the contaminants plot. |
Source code in msreport\plot\quality.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
missing_values_horizontal
Horizontal bar plot to analyze the completeness of quantification.
Requires the columns "Missing experiment_name" and "Events experiment_name", which are added by calling msreport.analyze.analyze_missingness(qtable: Qtable).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
Returns:
Type | Description |
---|---|
tuple[Figure, Axes]
|
A matplotlib Figure and Axes object, containing the missing values plot. |
Source code in msreport\plot\quality.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
missing_values_vertical
missing_values_vertical(
qtable: Qtable, exclude_invalid: bool = True
) -> tuple[Figure, list[Axes]]
Vertical bar plot to analyze the completeness of quantification.
Requires the columns "Missing experiment_name" and "Events experiment_name", which are added by calling msreport.analyze.analyze_missingness(qtable: Qtable).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
Returns:
Type | Description |
---|---|
Figure
|
A matplotlib Figure and a list of Axes objects containing the missing values |
list[Axes]
|
plots. |
Source code in msreport\plot\quality.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
sample_correlation
sample_correlation(
qtable: Qtable,
exclude_invalid: bool = True,
labels: bool = False,
) -> tuple[Figure, list[Axes]]
Generates a pair-wise correlation matrix of samples 'Expression' values.
Correlation values are calculated using the Pearson method and the "Expression" values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
labels
|
bool
|
If True, correlation values are displayed in the heatmap. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
If less than two samples are present in the qtable. |
Returns:
Type | Description |
---|---|
Figure
|
A matplotlib Figure and a list of Axes objects, containing the correlation |
list[Axes]
|
matrix plot and the color bar |
Source code in msreport\plot\quality.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
|
sample_intensities
sample_intensities(
qtable: Qtable,
tag: str = "Intensity",
exclude_invalid: bool = True,
) -> tuple[Figure, list[Axes]]
Figure to compare the overall quantitative similarity of samples.
Generates two subplots to compare the intensities of multiple samples. For the top subplot a pseudo reference sample is generated by calculating the average intensity values of all samples. For each row and sample the log2 ratios to the pseudo reference are calculated. Only rows without missing values are selected, and for each sample the log2 ratios to the pseudo reference are displayed as a box plot. The lower subplot displays the summed intensity of all rows per sample as bar plots.
It is possible to use intensity columns that are either log-transformed or not. The intensity values undergo an automatic evaluation to determine if they are already in log-space, and if necessary, they are transformed accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qtable
|
Qtable
|
A |
required |
tag
|
str
|
A string that is used to extract intensity containing columns. Default "Intensity". |
'Intensity'
|
exclude_invalid
|
bool
|
If True, rows are filtered according to the Boolean entries of the "Valid" column. |
True
|
Returns:
Type | Description |
---|---|
tuple[Figure, list[Axes]]
|
A matplotlib Figure and a list of Axes objects, containing the intensity plots. |
Source code in msreport\plot\quality.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
set_active_style
Set the active plotting style for the msreport.plot submodule.
The chosen style, potentially modified by the rc dictionary, will be applied temporarily using a context manager within the library's plotting functions. This does not modify the global matplotlib rcParams permanently.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
style
|
str | None
|
The name of the base style to activate. This can be one of the built-in msreport styles (e.g., 'notebook', 'powerpoint'), a standard matplotlib style, or a style registered by another library like Seaborn (if available). |
required |
rc
|
dict[str, Any] | None
|
An optional dictionary mapping matplotlib rcParams names (strings) to their desired values. These settings will be applied after the base style, overriding any conflicting parameters from the base style for the duration of the plot context. |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If the specified base style name is not found among the library's styles or the available matplotlib styles. |
TypeError
|
If rc is not a dictionary or None. |
Source code in msreport\plot\style.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
|
set_dpi
set_dpi(dpi: int) -> None
Changes the default dots per inch settings for matplotlib plots.
This effectively makes figures smaller or larger, without affecting the relative sizes of elements within the figures.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dpi
|
int
|
New default dots per inch. |
required |
Source code in msreport\plot\style.py
101 102 103 104 105 106 107 108 109 110 |
|