How to remove the lines/markers on a matplotlib legend? - matplotlib

By default when I call matplotlib legend the output is:
But in my case, I want the text to have the color of the line and I want to remove the line of the legend.
Desired outcome:
How can I do this?
Partial sucess
My searches only allowed me to get the text with the correct colors
and puting those lines transparent
But there is still space on the legend box.
Is there a way to make this?

I ended up finding the answer:
When you call the legend add these properties
ax.legend(handlelength=0, handletextpad=0)
Those lines are called handles, and you set their length to 0 and with no pad between them and the text.

Related

Altair tooltips: Is there a way to format box shape for long text?

I have a chart where I want to display text tooltips of variable lengths as long as 300 characters, but they are displayed with random box sizes. Sometimes they are shown in a neat square box with several lines of text, which is nice. But sometimes they attempt to put all the text in one line and it doesn't fit in the chart, so some part of the text is not visible.
I wonder if there is a way to format the tooltip box to a fixed maximum width to avoid this problem.
Below are two pictures showing the same chart. The first one shows a tooltip box out of the chart and page, so the complete text is not visible. The second one shows another tooltip that randomly shows the text fine.
Note: I tried cutting the text to a fixed length of 50 or 80 characters and it's better, but I would prefer to have the complete text.

Coreldraw Multiple Contours in VBA

Guys I Am trying to set up a three colour text that is editable
Basically what I want is the text to be black
A 1st contour of 1mm that is white
a 2nd contour of 2mm thick which is black
I have tried the following 2 step contour
ActiveSelection.CreateContour cdrContourOutside, 2, 2, , , CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255)
this works perfectly as I want and when I edit the text the contour changes to the new text however the contours are both the same width (2mm) and not 1 & 2mm as i want
Also I cant get it to specify the correct color for each contour
If I break apart the 1st contour then add another this gives me contours of different widths and colors but I then loose the edit ability as the contour is not attached to the text
Any Ideas I Know its possible as I have seen a commercial macro that does it
Any Help appreciated
Mark
The best I can do for you is to show you the object model. I do not have CorelDraw and therefore cannot test anything.
Here is the link to the CorelDraw Object Model.
http://apps.corel.com/partners_developers/csp/resources/CorelDRAW%20VBA%20Object%20Model.pdf
And here is a link to a Programming Guide for CorelDraw.
http://apps.corel.com/partners_developers/csp/resources/dvba_pg.pdf
You can look up "Applying Effects" on page 72 of the programming guide which may help.
I would suggest also looking at creating curves from the .Shapes object and then looking at the TextRange object. the TextRange.Text property is the actual text you want to see and the TextRange.colorindex is the color of the text I believe. You will have to do some exploring, but this should help.

Can VBA detect line-wrapping in an Excel chart legend?

Context
Writing to code to format a chart (all of which should be done by Microsoft, but that’s separate).
Am now positioning the legend. Taking a 9×9 block of possible positions, and counting the data points underneath each. As a fragment of the code: (ax.MaximumScale - ax.MinimumScale) * co.Chart.Legend.Width / co.Chart.PlotArea.InsideWidth.
Also coping with lines underlapping and text boxes overlapping the possible legend positions: same idea, more complexity.
Question
Obviously, all this works better if the legend is as small as possible, as that gives a greater likelihood of finding a location with zero ’lapping.
If .Legend.Width is too small, then the individual legend texts (the Series.Name’s) wrap onto ≥2 lines, which isn’t wanted. So VBA could interval bisect to find the smallest .Legend.Width for which there isn’t line wrapping. But how can the VBA code ‘see’|‘detect’|‘know’ of the existence of the line wrapping?
And mutatis mutandis for .Legend.Height: if that’s too small, some legend entries aren’t shown. How can the VBA code ‘see’|‘detect’|‘know’ that a height is too small?
Thank you.
PS: I expect that the correct answer is that “VBA cannot ‘see’|‘detect’|‘know’ either of these.” Please refute this expectation.
If you create your own legend, using a text box, you have better options when it comes to sizing and flow control. This will create a new set of challenges, but it might be easier to handle.

SSRS line chart

I have one question to the line chart.
I would like to create a line chart, which values are given. It should look like this chart here:
My question is, how can I implement this. I tried to put it as a stripline in the chart but it only shows a horizontal line without this steps at the beginning.
How can I create this line chart like in the picture above?
can I put into this:
the values.
Striplines are intended to display just a line across the chart, or varying width, height, to demonstrate an area... from MSDN
Strip lines, or strips, are horizontal or vertical ranges that shade the background of the chart in regular or custom intervals
To get the behaviour (I think) you require you can add a new series to the data you are returning with each of those datapoints. Irrespective of what other data you are charting, you can change the type of this series to Line Chart, and change the order of the series on teh chart to make it uppoermost.
Without further information - such as the data you are tyrying to superimpose this on - it's hard to advise further.

VB.NET: Mark Points in Line Chart

I'm creating a Chart with Lines on it in VB.NET. Now I got multiple Values in one Line. I want to mark certain of these values with a little Circle (or a Sqare, nevermind).
How do I have to do this?
It should look right light this:
How to Achieve?
Setting the Point's Marker does the Trick:
dataGridView1.Series(0).Points(0).MarkerStyle = DataVisualization.Charting.MarkerStyle.Circle
dataGridView1.Series(0).Points(0).MarkerSize = 10