Google Visualization: Keep data points visible - google-visualization

I'm wondering if there is a way to keep the dots visible for each data point on a line chart. The default behavior is that a dot only appears on a data point (along with a tootip) when you hover over it. I'd like the data point dots to be visible by default. Is there a way I can go about doing this?

The pointSize attribute is responsible for the dot size. So something like chart.draw(data, {pointSize: 1}) should make the points visible by default. (The default setting is size 0.)
Hope that helps!

You can use pointSize options. By default its set to 0, that hides the data points. Set it to a value according to the size of the dot that you want. Something like pointSize: 4 is a good choice.

Related

Determine when a cell is blank

At work, I needed that if the value of a cell is equal to the cell next to it, then the background color changes to red, but it is doing it for blank cells, so it may be confusing for others.
Is there a way to avoid blank cells?
I have this formula:
=IF($D2=$C2,TRUE)
then background color changes to red (not sure if the correct formula, but it worked at the beginning, I am doing this in the Conditional Format Rules in Google Sheets).
I used this:
=IF($D1=$C1,IF(ISBLANK($D1),FALSE,TRUE))
I set the range to be C1:D1000. Your formula was putting the formatted color on the row above the data being checked. This formula checks if they are equal. Then if so it checks if one is blank. You don't have to check if they are both blank, the formula already knows that they are equal. So then if they are equal, return false, otherwise return true.
Clear formatting from C2 to wherever in ColumnD suits and with that selected then Format - Conditional formatting..., Custom formula is and:
=($C2=$D2)*($C2<>"")
Then select formatting of choice and Done.

Caffe: Multi-Label Images with Varying Number of Labels

I have a dataset where the images have VARYING number of labels. The number of labels is between 1 and 5. There are 100 classes.
After googling, it seems like HDF5 db with slice layer can deal with multiple labels, as in the following URL.
The only problem is that it supposes a fixed number of labels. Following this, I would have to create a 1x100 matrix, where entry value is 1 for the labeled classes, and 0 for non-label classes, as in the following definition:
layers {
name: "slice0"
type: SLICE
bottom: "label"
top: "label_matrix"
slice_param {
slice_dim: 1
slice_point: 100
}
}
where each image contains a a label looking like (1,0,0,...1,...0,....,0,1) where the vector size is 100 dimension.
Now, I apologize that my question becomes somehow vague, but is this a feasible idea? I.e., is there a better approach to this problem?
I get that you have 5 types of labels that are not always present for each data point. 1 of the 5 labels is for 100-way classification. Correct so far?
I would suggest always writing all 5 labels into your HDF5 and use a special value for when the label is missing. You can then use the missing_value option to skip computing the loss for that layer for that iteration. Using it requires add loss_param{ ignore_label = Y } to the loss layer in your network prototxt definition where Y is a scalar.
The backpropagated error will only be a function of labels that are present. If input X does not have a valid value for a label, the network will still produce an estimate for that label. But it will not be penalized for it. The output is produced without any effect on how the weights are updated in that iteration. Only outputs for non-missing labels contribute to the error signal and the weight gradients.
It seems that only the Accuracy and SoftmaxWithLossLayer layers support missing_values.
Each label is a 1x5 matrix. The first entry can be for the 100-way classification (e.g. [0-99]) and entries 2:5 have scalars that reflect the values that the other labels can take. The order of the columns is the same for all entries in your dataset. A missing label is marked by a special value of your choosing. This special value has to lie outside the set of valid label values. This will depend on what those labels represent. If a label value of -1 never occurs you can use this to flag a missing label.

Pyplot rotated labels offset by one

Just getting into matplot lib and running into odd problem - I'm trying to plot 10 items, and use their names on the x-axis. I followed this suggestion and it worked great, except that my label names are long and they were all scrunched up. So I found that you can rotate labels, and got the following:
plt.plot([x for x in range(len(df.columns))], df[df.columns[0]], 'ro',)
plt.xticks(range(10), df.columns, rotation=45)
The labels all seem to be off by a tick ("Arthrobacter" should be aligned with 0). So I thought my indexing was wrong, and tried a bunch of other crap to fix it, but it turns out it's just odd (at least to me) behavior of the rotation. If I do rotation='vertical', I get what I want:
I see now that the center of the labels are clearly aligned with the ticks, but I expected that they'd terminate on the ticks. Like this (done in photoshop):
Is there a way to get this done automatically?
The labels are not "off", labels are actually placed via their "center". In your second image, the corresponding tick is above the center of the label, not above its endpoint. You can change that by adding ha='right' which modifies the horizontal alignement of the label.
plt.plot([x for x in range(len(df.columns))], df[df.columns[0]], 'ro',)
plt.xticks(range(10), df.columns, rotation=45, ha='right')
See the comparison below :
1)
plt.plot(np.arange(4), np.arange(4))
plt.xticks(np.arange(4), ['veryverylongname']*4, rotation=45)
plt.tight_layout()
2)
plt.plot(np.arange(4), np.arange(4))
plt.xticks(np.arange(4), ['veryverylongname']*4, rotation=45, ha='right')
plt.tight_layout()

how to set min-height of row of blocktable in rml

How to set min-height of row of blocktable in rml? I read the rml-reference and can't find any related content. I only found the attr: rowHeights, But it seems that it just set a fixed height, the content will flow out. I wanna set a base height,and when the content increases the height of row increases too.
Thanks in advance!
I don't think that's possible for v7 or lower (v8/trunk no idea).
As you've stated right, rowHeights sets fixed heights for rows and without that attribute you will have auto-sized heights.

Transform only one attribute in Raphael

I have a Raphael set that I'd like to move by 400px vertically.
When I drew the paths, I applied individual x-axis transformations to all of the paths in the set. When I try to apply the y-axis transformation, I lose my x values. What's the solution?
sampleIcon = self.paper.path(path).attr({'transform': 't' + (someWidth*index) + ',60' });
iconSet.push(sampleIcon);
// when I click on something
iconSet.animate({transform: 't' + (original x-transform value for each icon) + ',400'});
Or is there a way to omit the x-transform entirely?
Raphael's lack of a comprehensive solution for this issue (bulk animation of arbitrary sets of objects) is one of its most serious limitations in my opinion. If all you need to do is translate items, however (and without using overlapping animations), you're in luck!
Simply add the "append" modifier to your translation strings, like this:
iconSet.animate({transform: '...t' + (original x-transform value for each icon) + ',400'});
This will effectively "add" the given translation to the currently translated state of each item in the set. You can do the same thing with rotation and scaling, of course.