Disabling padding does not work for empty plots (WinForms)
See original GitHub issueDescribe the Issue: I use it as the initial Form. I can’t achieve my goal without data. Like this: Without data: The LightBlue is the padding that I want to eliminate. But I can eliminate it by adding the data. Like this: With data: This is my code and it is the demo about Customize: Figure - No Padding.
var plt = this.scottPlot.plt;
plt.PlotHLine(2);
plt.Style(figBg: Color.LightBlue);
plt.Style(dataBg: Color.LightYellow);
plt.Ticks(false, false);
plt.Frame(false);
plt.TightenLayout(padding: 0);
scottPlot.Configure(recalculateLayoutOnMouseUp: false);
scottPlot.Render();
How can I eliminate the padding except by Adding data?
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
WinForm Bottom Margin Property Doesn't Do Anything
1 Answer. The Margin property is used by the automatic layout feature built into Winforms. But it does require that you allow the...
Read more >Padding.Empty Field (System.Windows.Forms)
Provides a Padding object with no padding. ... An empty padding object is defined as having the Right, Left, Bottom and Top padding...
Read more >Removing extra whitespace under x-axis of reporting graph
The default Graph padding is '10px'. You may set it to a negative value, for example '-10px', to reduce the empty space below...
Read more >ScottPlot 4.0.47 Cookbook
This example demonstrates how to plot OHLC data continuously even though there are gaps on the horizontal axis (for days the market is...
Read more >PySimpleGUI
One simple call, write_event_value , solves threading issues. Not ready for the threading module but need to run a thread? Use window.perform_long_operation ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Further debugging,I find an amazing phenomenon. I remove the part of your code. So I can’t get my goal.
Before modification
After modification
The result
Automatic generated by Visio studio
I think it is my Heart of the matter. I add the code and get goals successfully.
Hi @YUXI07, thanks for the question and @bclehmann for your help along the way!
To summarize the problem, plots weren’t rendering framelessly in the FormsPlot control if they were empty, and that this is an an issue that only applies to version 4.0.
The fix is to instantiate the FormsPlot control by passing-in a new Plot with a defined size, rather than letting it create one.
I too am puzzled by this solution, but am happy to hear @YUXI07 ended-up with something that gets the job done! 👍