How do I reduce the X axis on a Google Chart? - google-api

I'm doing a bar chart with google, and my results look like this (link).
If you see that the graph is not beautiful enough. What is the parameter that can reduce the value on the x axis.
Thank you in advance.

try this one
I just added chds=0,10 to scale it properly. That basically sets the data range to 0 min, 10 max.

I would take a look at this link from google regarding Data Scaling. I am not sure of your data set format so the actual answer to your problem will depend on that.
i.e. - I added "&chds=0,10" after your "chd=" statment and got a better looking chart. Example.

Check out the help file here.
Decide whether your data must be scaled to fit your chart. Different formats support different ranges of values. You might want to scale your data so that it spans the full range of values allowed by your format, to make differences more obvious. You can do this either by scaling your data to fit within the data format that you use, or you can use text formatting with custom scaling.

Related

How to add multiple geojsons to a geochoropleth in dc.js?

I'm trying to create a geochoropleth that maps subregions, but also includes outlines of larger regions. (You can think of it like mapping counties, but then wanting to include thicker outlines of states). Not all subregions are part of larger regions that need to be outlined. (Most aren't.) You can see an example of what I'm trying to replicate here:
What's the best way to add this regional outline to my map? I've tried keeping the regions and subregions as two separate files, with two overlaygeojsons calls in my geochoropleth call (with added d3 styling to change the fill and stroke to just be an outline). But when I do - the projection of the regional outline layer is strangely offset from the lower one.
I've also considered having both sets of boundaries in just the one geojson. However, I wasn't sure how to work with this.
While it would be nice to be able to mouseover the boundaries of the larger regions and get a tooltip before crossing over into the individual subregions and getting their tooltips, this isn't a must. I could live with just outlines around the regions. Please advise on the best way to do this. Happy to provide more detail, and thanks so much!
EDIT: I discovered that I had a misplaced transform tag which is what offset the second layer. Fixed now!

How to set spacing in Frangi filter for 3D stack of DICOM data

I am using the Frangi filter for hepatic vessel segmentation.
The problem is that that data are not isotropic [1,1,1].
I can do resampling. It creates more slices but it looses pixels and its not so precise.
I found, that maybe I can change it directly in the Frangi function (skimage function) in the script where the Hessian function is computed. But even then I don't know which values I should set up as spacing.
Because now I have some results, but they are not correct, because I am computing with squeeze image in z-direction.
Thank you for your help.
By my reading of the code, currently it is not possible to use a different scale (sigma) for the different axes — we assume the same sigma is used for each axis. It should be possible to improve this in a future version. You can create a feature request at https://github.com/scikit-image/scikit-image/issues/new/. I suggest that you link back to this question when creating it.

dc.js Boxplots displaying values

Has anyone added the ability to display values in a boxplot for dc.js?
Interesting answer given to this question related to matplotlib.
Adding a scatter of points to a boxplot using matplotlib
As it's currently implemented, the box plot will display any outliers as circles, and outliers are defined as the points which do not fall within the whiskers.
If you're willing to change the source, it's pretty easy to disable the whiskers and show all the data points.
You just need to change line 42:
var _whiskers = _whiskersIqr(_whiskerIqrFactor);
https://github.com/dc-js/dc.js/blob/356fccea3a1dbd49a76fb1841f280ffad87d725f/src/box-plot.js#L42
You could just set it to null, or add an accessor for whiskers. (There really should be one, looks like an oversight.)
It looks like this with no whiskers:
You'd have to dig a bit deeper and change the underlying d3-plugin if you want to display whiskers along with the data points.

Feature Scaling, how to standardize

Well I've an image and a vector, the vector consists 3 datas, positonX, positionY and Intensity(0-255).
How do I standardize this, should standardization be done for each pixel or for an entire column, Also once standardized, for example I take the mean of 5 pixels, how do I get the original values(destandardize) back?
Can you please elaborate what are you trying to achieve and platform you are using in case you are using R you can try a package called imager. ..let me know if it helps

D3 Area chart that tends to zero where values are missing

I have data like this:
document: [{"key":"01/01/2001","values":2},
{"key":"02/01/2001","values":1},
{"key":"31/01/2001","values":2}]
I am creating an area chart with .interpolate("linear") to create the following:
The idea being to represent number of documents "created" throughout January.
However, this is kind of a misleading output as it would imply there are values throughout January, when there aren't just 2 at the start and one at the end.
My questions are:
Fundamentally is this the wrong graph to represent this data, and should a bar chart be used instead?
Can D3 add evenly spaced "zero" values for each day in January?
Is the best we can do is use .interpolate("cardinal") to produce something like:
Thanks in advance!
I think the answer from this other SO post gives a usable answer, reposting it here so that this is not a dead-end for visitors coming from Google and finding this post first (as I did).
d3 linechart - Show 0 on the y-axis without passing in all points?

Resources