question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix cookbook SaveFig() and create Multiplot.GetSubplot()

See original GitHub issue

One small issue is an error I get using the “Multiplot” demo code on this page is that plt.Save results in the compiler saying that there is no definition or methods for Save. SaveFig does the job, but does not provide an overload to pass the plot dimensions. The dimensions are instead defined when the new plt object is created. I’m curious as to why there are two different methods? Could they be combined into one?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
StendProgcommented, Feb 9, 2020

Indexing starting at 1 looks unusual for c# users.

More perfect and simple solution is to store subplots at rectangle array initially.

public readonly Plot[,] subplots;
or
public readonly Plot[][] subplots;

Multiplot indexer overload can also give simple API:

var mp = new ScottPlot.MultiPlot(rows: 2, cols: 2);
mp[1, 2].Title("Random Points");

Not sure double indexer overload possible.

0reactions
swhardencommented, Feb 10, 2020

@StendProg done!

I won’t do the rectangular array because I want to make it slightly easier to support non-rectangular layouts if we decide to in the future. GetSubplot() will be easy to overload to add advanced features like this.

Thanks for both of your help on this one! I’ll release the next version on NuGet shortly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Matplotlib savefig() over multiple graphs keeps saving the ...
So I have a function generategraph(file) which correctly creates a bar graph based on the data in the parameter and then saves it....
Read more >
ScottPlot 4.0.47 Cookbook
You can create a filled scatter plot where the area between the curve and baseline is shaded with a color. The baseline defaults...
Read more >
ScottPlot/CHANGELOG.md at main
Ones() to generate arrays filled with values using methods familiar to numpy users. Added equalAxes argument to WpfPlot.Configure() (#272); Fixed a bug ...
Read more >
Figures, plots & subplots: A simple cheatsheet for ...
A quick reference for matplotlib, Pillow, and cv2 to make life easier when plotting graphs & images.
Read more >
A Few Complex Plots
In many cases these show how to make multi-panel plots. ... This can only be set on save via the mpl_kwargs parameter to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found