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.

Line Plot: Show position label on axis

See original GitHub issue

Feature description:

It would be very nice to have the posibility of tooltip for Draggable axis similar to crosshair tooltip #1093

VLine vLine = new VLine();
vLine = formsPlot.Plot.AddVerticalLine(0);
vLine.DragEnabled = true;
vLine.LabelEnabled = true;   // new

HLine hLine = new HLine();
hLine = formsPlot.Plot.AddHorizontalLine(0);
hLine.DragEnabled = true;
hLine.LabelEnabled = true;   // new

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
swhardencommented, Aug 8, 2021

Very quick question Scott before I start coding, is there a performance impact due to drawing the PositionLabel?

Technically yes, but it’s extremely minor. The difference is effectively negligible 👍

1reaction
swhardencommented, Aug 7, 2021

Thanks for the suggestion @EmanuelFeru! This one took me a while to get to, but I’m finally making progress. I’m combining this with crosshair refactoring #1173, and it looks like we’ll have something pretty similar to this shortly:

var plt = new ScottPlot.Plot(400, 300);
plt.AddSignal(DataGen.Sin(51));
plt.AddSignal(DataGen.Cos(51));

var hline = plt.AddHorizontalLine(.85);
hline.LineWidth = 2;
hline.PositionLabel = true;
hline.PositionLabelBackground = hline.Color;
hline.DragEnabled = true;

var vline = plt.AddVerticalLine(23);
vline.LineWidth = 2;
vline.PositionLabel = true;
vline.PositionLabelBackground = vline.Color;
vline.DragEnabled = true;

Func<double, string> xFormatter = x => $"X={x:F2}";
vline.PositionFormatter = xFormatter;

draggable

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Adjust Axis Label Position in Matplotlib
This tutorial explains how to adjust the axis label positions in a plot in Matplotlib, including several examples.
Read more >
How to align axis label to the right or top in matplotlib?
With respect of acting directly on matplotlib 's defaults, I've browsed the plt.rcParams data structure but I haven't spotted anything useful.
Read more >
How to Adjust the Position of Axis Labels in Matplotlib
In conclusion, adjusting the position of axis labels is an important part of using Matplotlib to make plots that are clear and accurate....
Read more >
Axis Label Position — Matplotlib 3.7.2 documentation
Choose axis label position when calling set_xlabel and set_ylabel as well as for ... cbar = fig.colorbar(sc) cbar.set_label("ZLabel", loc='top') plt.show().
Read more >
Positioning of Pgfplot axis labels
You can control the position of labels accurately with at={(axis description cs:0.5,-0.03)}. The start of the axis is 0 and the end is...
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