Numbering and titling graphs in R-markdown - pdf

In r-markdown pdf report I need to number and caption all my graphs and nothing I could find on the internet helped. So each picture or graph displayed needs to be something like
"Picture 1: qq-plot of the variable "age"."
The problem is also with two graphs in a single code chunk. To be precise, they aren't in a single merged graph, but two separate graphs with each their own cooedinate system.

Related

VB.NET Charting Series Format A Name options

I would like to know if it's possible to format a "Data - Name" of The Series such as; Font, Size Alignment, and positioning.
I run into an issue where Printing the chart doesn't display the name(different than images) because of its length.
However, App and controls do, correctly. So I was hoping to re-format when calling on Print.
There is no code(mine) as I couldn't find anything related to what I am trying to achieve it seems like all refers to an actual data points formatting but NOT a name formatting itself.
Thank you

Visio - How to ungroup shapes but keep the same names?

I'm working on Visio (I didn't to the file) and all the shapes are grouped, there is only one shape by group and when I ungroup all the shapes all the names are modified and replaced by random names like "sheet.8331" , do you know if there is a way to ungroup all the shapes without modifying the names of shapes ? Thank you very much in advance
You could read the names prior to ungrouping (VBA), but it is generally a bad idea to use names.
You better rely on fields in the user section to identify shapes.
eg: user.MyIdentificator = "It's me!"
Retrieving the shape is as easy as:
for each shp in activepage.shapes (or in parent_shape)
if shp.cellexists("user.MyIdentificator", visExistsAnywhere) then
if shp.cells("user.MyIdentificator").ResultStr("") = "It's me!" then
'do your stuff
... closing ifs and loops
HTH,
I suspect GG made a "shape" that was a set of shapes, then dragged them onto a stencil.
You may not need to ungroup, as there is a way to "go inside of the group" and make changes. Many users that are destroying things by ungrouping are unaware of "group-editing windows".
Just right-click any group, then choose Group > Open Group, or Group > Open SomeName.
I'll add some more technical mumbo-jumbo that may help other readers who find their way to this thread.
When the newly-created master is dragged back into a drawing, Visio groups the shapes together. This is to preserve the inheritance that Visio establishes between the local master (stored in the Document Stencil of the drawing file) and each instance of the master on the pages of the document.
The inheritance is a way of saving data---shapes on pages aren't all copies of their original masters, then inherit the properties of masters. Only bits that the user changes, such as location, size, text, etc. are overridden. This inheritance can be a powerful tool, can save on file size, but can also be confusing.
When you ungroup the master, you sever it's link to the master, and the shapes become new copies with no inheritance. Visio has to give them names. I'm not sure why your original names are lost. I would think you would end up with a bunch of names that look like "NameOriginal.3", "NameOriginal.46", etc. That's what happens in my tests.
Anyway, names must be unique "at scope" - meaning at the same level of grouping. So for shapes just sitting on the page, there can only be one "Bob". If you make a copy of "Bob", he'll be "Bob.46" or something.
I can have 7000 groups that each have a subshape named "Bob", since each "Bob" exists in its own unique scope--the group shields one Bob from another. But all of those Bobs will have unique "SheetID" indices. Those can be used for doing cross-sheet formula references in the ShapeSheet.

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.

DevExpress XrChart curve prints to PDF but not on Print-Out

I have two line charts on a DevExpress xtrareport. For some reason, the curves are drawn fine on one but not the other.
If I print the report using PDF995 application, or using Microsoft XPS document Writer, both charts appear fine.
However, if I print the report directly to the printer (a TA/UTAX), the curves on one of the graphs don't appear at all.
This is a screenshot from the output of the XPS document.
But when it's sent directly to the printer, the curves don't appear on the left hand graph. Below is a scan of the same graphs printed to the printer.
I'm fairly positive it is related to the data in the data series because if I switch the binding so that the right-hand graph uses the current left-hand data, I get the same problem but with that graph. However, on examining the data, I can't find anything amiss.
The data comes from a list of Tuples (string, decimal, decimal):
The SeriesDataMember is bound to Item1
The ArgumentDataMember is bound to Item2
The ValueDataMembers Value is bound to Item3
And the report is printed using the DevExpress ReportPrintTool.Print() method.
Strangely, the graph on the left in the screenshot is printed fine, and that gets its data from a similar data structure.
What could be different between printing to an actual printer and printing to a PDF writer? (PDF995)
Edit
As per my comment, starting the curve at -0.01, -0.01 allows extra space below the origin and then the curve prints fine. This currently works as a workaround as the graph will never be printed in a fine enough detail to notice the difference between 0.01 and 0. But still... weird...
is that curves visible on the real printer if you try to print result Microsoft XPS document file?
currently i think that your problem is in your printer : (

Inconsistent behaviour with proc greplay in batch vs. interactive sessions

I have some SAS code that draws 2 charts on identically scaled axes - one stacked vertical bar chart, and one line chart. It then draws the lines on top of the bars via proc greplay to produce a stacked bar + line chart. This is output to pdf via ODS.
When I run my code in an interactive SAS session, it works as intended - the 2 charts are the same size and line up exactly on top of one another. However, if I run exactly the same code in a batch session, the bar chart is squashed into the left half of the chart area and the line chart is displayed at full size.
Any idea what could be causing this? It's possible that there are some different settings between the batch and interactive sessions, but I'm not sure which ones could be responsible.
I was only including the final proc greplay inside the ODS sandwich used to produce the pdf. Once I put the preceding chart procs, goptions statements etc. there as well (using goptions nodisplay to make sure that the individual charts didn't end up in the PDF before being overlaid), it all rendered as expected.