How to add descriptions on selected data series to an area plot in mathplotlib - matplotlib

I created a graph that looks alright to me with the following line of code:
df_wide.plot.area(xticks=df_wide.index, legend=False, xlabel= 'Week', ylabel='Percent', title='Percentage of Letters')
However I would like to add the name of selected (or all) dataseries to the right side of the Graph, so that it attaches little lines to the right side and the column name appears next to it, I attach a picture with my current output and how I want it to look (not exactly well edited, but I am sure you get the idea)...
Maybe somebody can helb me :) Thank you!

Related

CATIA VBA: Extract name of generated point in CATDrawing

I'm tearing my hair out trying to work with generatedpoints in draft view. I have a 3D model with points that are named in a particular way, per the picture below:
point names
Then on the CATDrawing, I have generated views that show those points. if I click those points in 2D, they are named in the following manner, "GeneratedPoint (insert 3D point name here)". You can see this naming example below:
2D generated naming
Now, what I'm trying to do in VBA is run a code that will select those generated points in a view, duplicate geometry on them, and name that duplicated geometry to match the 3D point names. My problem is, I can't seem to access the "GeneratedPoint" names that show up when I click the points in 2D. Below is a snippet of my code where I'm trying to access the name of the selected points:
For j = 1 To totalcnt
Set bSel = aDoc.Selection
bSel.Add ActiveView
bSel.Search "Name='*GeneratedPoint *',sel"
Set nm = bSel.Item(j)
desc = nm.Name
desc = nm.Value.Name
Usually when I have a selection, and I make an object from one of those selections, I can access the name through selection.Item(j).Name or selection.Item(j).Value.Name, but in this case neither one works.
at the desc=nm.Name line above, it gives me a name of "CATIASelectedElement16", not the actual name I see in the status bar when I click it in the drawing. And when I use desc=nm.Value.Name it gives me "Front View", which is the name of the view these points are in. I know it's selecting the points correctly, I can see them get selected, and I can see the count on the selection object matches my number of points. What am I missing? For reference, when I run the line Set nm=bSel.Item(i), that object looks like this in the Locals window.
Object in Locals window
As you can see in that picture, the object Type is DrawingView, whereas I would expect it to be a point. Does anyone have any ideas on how to access the name of a generated item in 2D? So far the only way I can interact with it at all is by using selection.Search, which will find them by name, but I have no way of then actually using the specific names of those points it found. Any insight would be appreciated!

Pictures do not go to their designated spots when copied to canvas

Link to code
I am attempting to move 5, individual pictures (as defined at the beginning of the code) and manipulate each picture in a different way. Each function that is used to manipulate a picture has a pretty obvious name for what is going to happen to that picture
I am using Jes to code this in Jython.
My problem is that even though I clearly specify where on my final canvas that I want these pictures to go to, they for some reason all default to (0, 0). So basically, the only picture that will be displayed is whichever the last one is that is called on. If you were to comment out the last picture, which in the code is the fifth (the "lighten" one), the fourth picture would be the one that got displayed instead so this proves that the pictures are all defaulting to (0, 0). The pictures do not go to their designated spots and that is what I am having trouble with.
***Side note: the functions "greyScale", "colorAvg", "colorSwap", and "lighten" should have nothing to do with the problem. I also don't think my "copy" function should be a problem either but I could be wrong.
I changed my copy function so that the parameters are (picture, destination, targX, targY)
Then in the copy function I made it:
targetX = targX
and then later
targetY = targY

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.

How to Create a Report Containing 3 DataTables

Goal
I want to create a report that will contain three DataTables (unless doable with 1 DataTable, you tell me!). The following screenshot displays ConveyorNames, OptionNames, ConveyorOptionPrices:
Problem
The problem I am facing is I cannot seem to figure out how I will go about displaying horizontal conveyor Names (Conveyor1, Conveyor2, Conveyor3, ...) horizontally while displaying OptionNames (Optn1, Optn2, Optn3, ...) vertically; while at the same time populating the price for Conveyor1 and Optn1 (and so on) in their relative cells.
I'd like to provide something that I have tried, but nothing conclusive as of yet would be useful here. To be honest, I don't even know where to start. If anyone can point me in the right direction, I'll be very thankful!
I figured it out using only 1 DataTable. You must create a Matrix and attach this DataTable to it.
Related to my example, my DataTable will contain the following fields: ConveyorName, OptionName, and OptionPrice like so:
Afterwards, I just loop through my three DataTables and fill in the fields like so:
For Each convRow As ds1.dtConveyorsRow In dsConv.dtConveyors
For Each optnRow As ds2.dtOptionsRow In dsOptn.dtOptions
For Each convOptnRow As ds3.dtConvOptnsRow In dsConvOptn.dtConvOptns.Select("FK_Conveyor=" & convRow.PK_Conveyor & " AND FK_Option=" & optnRow.PK_Option)
dtRpt.AddConvOptnRow(convRow.ConveyorName, optnRow.Name, convOptnRow.Price)
Next
Next
Next
Which populates it exactly as I showed in my question's picture.

Creating a line in an excel chart which always shoots a red line through todays date in VBA

I have a chart which I would like to always run a line through today's date after I run a Macro I am working with. I would also like it to say Today right above the chart and above the red line. I would like to code this out in VBA but I don't really know where to begin. I have the chart Does this make sense? Thanks.
Read through this and combine with =TODAY().
Edit: The specific formula you'd be using for your column of vertical lines is
=IF('cell in same row containing date'=TODAY(),MAX('range of your data'),"")
This formula will return the max from your list of data if the date in your table is today's. If you follow the instructions for option 2 from the link and create another data series for vertical lines and put this formula in that column, you will have a vertical line that is always on today's date.
One more Edit: To address having "Today" above the line, add data labels to your "Today" series by right clicking on the series and going to "Add Data Labels." Right click on the Data Labels and go to "Format Data Labels." Go to "Number" and select Custom. Enter "Today";;; into the Format Code box and click add. Your Data Labels for your blanks should go away and your date line should have "Today" over it. Format it however you wish.
And if you want to make this part of a macro, record it and play around with the code you get until you find something that works. IMO, just having this as a part of your chart is easy enough.
Last edit I swear: If your line is too fat, right click on the series/line, go to "Format Series," change the fill to a gradient, set the rotation to 180*, and play around with the stop positions and transparencies to make the line appear thinner. That's all I've got, so if I've helped in any small way, mark this as useful.