![]() One option is also to remove the effect of users preferences, but depending on the platform this might take a lot of effort to set all default values to 1 or 0. Names Default To Here(1) Īxisbox = (Report(dist) << XPath("//ScaleBox")) Īxisbox << Add Ref Line(55, "Dotted", red, "F mean", 2) Usually I use XPath with some combination of << child, << sib, << parent and so on. Sometimes these have to be built a bit case by case. If there's multiple distributions in the report, loop through or be more specific when grabbing the xpath. use xpList instead of referencing an axisbox index. XpList = myrpt << XPath("//DropBox/BorderBox/AxisBox") // returns a list of matching occurrences Hopefully this stands the test of time, but it's worked for me so far. Meaning, don't just look for an axis box as there could be 4 of them, rather look for the axis box in a border box in a drop box, which appears to be unique to the 'main' axis. You can look at the xml, or look at the properties of an output report to see what might work. I probably could have found a workaround there, but ended up using xpath. I tried doing a 'get items' but I think it always returned 4 even though some were empty. But if the script is deployed widely, you need to account for other user preference settings. if you always have the same settings, you can hard code it and it should be fine. But if you add any of the other axes, the index becomes 2, 3 or 4 (the max of the total axes displayed. In the distribution platform, if you don't have the probability, density, and show counts axes set to be displayed, then the index for the axis box of the distribution's data is 1, meaning you can reference it with report(xxxx), similar to Jarmo's post above. I would not expect to be an issue in graph builder, mostly because I don't think user preferences come into play as much. It's related to the Distribution platform specifically (not graph builder which was in the original question), but may apply to other platforms depending on user preferences, I'm not sure. Specifically I'm dealing with the Kaggle Titanic dataset.This is tangentially related but I'll put it here anyway. I've plotted a stacked histogram which shows ages that survived and died upon the titanic. I would like to alter the chart to show a single chart per bin of the percentage in that age group that survived. if a bin contained the ages between 10-20 years of age and 60% of people aboard the titanic in that age group survived, then the height would line up 60% along the y-axis.Įdit: I may have given a poor explanation to what I'm looking for. Rather than alter the y-axis values, I'm looking to change the actual shape of the bars based on the percentage that survived. For non-adjacent bars, hold down the Ctrl key, click the non-adjacent bars, and then double-click one bar. The first bin on the graph shows roughly 65% survived in that age group. To select or deselect a range of adjacent rows or columns, hold down the Shift key and click the first and last row or column in the range.įor adjacent bars, hold down the Shift key and double-click the right-most bar. I would like this bin to line up against the y-axis at 65%. # Creating the plot that will show survival % per age group and genderĪx = survival_per_age_ot(kind='bar', color='green')Īx.set_title("Survivors by Age Group", fontsize=14, fontweight='bold') Then you can plot your graph as follows: survival_per_age_group = oupby('AgeGroup').mean() The graph would end up actually looking something like this:įirst of all it would be better if you create a function that splits your data in age groups # This function splits our data frame in predifined age groups The following bins look to be 90%, 50%, 10% respectively, and so on. Create, edit and view graphs wherever you are with the same Graph Builder engine found in JMP, the desktop. Right click on the columns that are in the graph. JMP Graph Builder is the best way to view and explore data right on your iPad. # Importing the relevant fuction to format the y axisįrom matplotlib.ticker import FuncFormatterĪx.t_major_formatter(FuncFormatter(lambda y, _: ''. ![]() Change the width from 10 to whatever specified length you want. ![]() ![]() ![]() So for example if you change the column width to 3. Column WHA2F14 will read 3.1 in the bar chart. Note: This method works only for continuous (interval) variables. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |