Is there a way to set scale value before fig up? - scale

If you scale a service 10x
fig scale www=10
then stop
fig stop
Fig will "cache" the amount of scaling, so next time i do
fig up
It will start already with 10x www.
Is there a way to avoid that?
At the moment if i try to set scale before doing fig up i get an error:
Starting xxx_www_1...
Cannot start container 7c8276e76ada36b183f1f9873abf4e28d4314227a1fa8980127763eb50c22700:
Cannot link to a non running container: yyyy AS zzzz

Related

Highlight values and save

I am using plotly to zoom my plots, save to svg and show most interesting intervals to customers. The thing I can't reach - I need to save picture with hover showing values.
For example, I zoomed, I pointed value I need to show, I see values using hover.
But when I press "Download plot" button - It's saved without hover information. Here is what I see in svg:
How can I show values on saved plots?
Here is my example code:
library(plotly)
x <- c(1:100)
random_y <- rnorm(100, mean = 0)
data <- data.frame(x, random_y)
fig <- plot_ly(data, x = ~x, y = ~random_y, type = 'scatter', mode = 'lines')
fig
I really don't know any thing about the software/code you are using but as a general logic you have some different approaches to solve this.
1-create a function to take a screenshot of the area you have on screen with those hovering elements and save it as a bitmap image. This is valid just if you don't require to save/download your plot as an svg file.
2- In case you need to export as svg then you have to create a function to observe and get the svg code which is displaying your plot at the moment of hovering, then save the whole stuff as svg file.
3-If what you require is to save the plot as a svg file then it is also possible that the hovering effect along with the code to produce the highlighted content, to be exported inside the svg. The only means most users have t visualize an svg file is via web browser, so when the parts conteining hovering are hovered they will show the effect and the information.
As I said, these are just general logic to try to find out a solution.

How to draw plot.dendrogram with labels at different levels (like plot.hclust)?

when I use default plot() for hclust object, it places leaves' labels at different distances, just as I need:
data(mtcars)
plot(hclust(dist(mtcars)))
But when I do the same for dendrogram object, it aligns all labels to the same level:
plot(as.dendrogram(hclust(dist(mtcars))))
How to disable this alignment and make it behave exactly like for hclust?
I tried hang=0 but it makes all "leaves" to have zero length:
You can do this by adjusting the hang parameter.
plot(as.dendrogram(hclust(dist(mtcars)), hang = 0))
plot(hclust(dist(mtcars)), hang = -1)
From the help page:
hang
The fraction of the plot height by which labels should hang below the rest of the plot. A negative value will cause the labels to hang down from 0.

Highchart - ThingSpeak - IoT - issues with graphs (axes)

I use Highcharts for my ThingSpeak IoT project.
All is fine except these things, which just makes me angry (I cannot find a solution on my own... I have been trying with my frind Google for last 3 days without any success).
Here is my project page: http://net.cekuj.net/
There are my issues:
1) I cannot see the most top number next to the Y axes (I can see only the tick, not the number - if you check browser console, it is there but it has wrong X and Y coordinates)
2) I cannot align "tick mark" for all Y axes according to the manual - I would like to align them "on" mark, but now there are still "between"... and yes I use added a var for this :(
3) I would like to use decimalplace setting independently for every series of data - for example - Temperature will have 1 decimal place, humidex will have 0 decimal place etc. is that possible?
4) I added major ticks, but no succes with adding minor ticks :(
I would be really happy if any of these 4 issues would be solved, thank you for your help and time!
EDIT:
Also autorefresh is not working, but it seems to be because of wrong URL pattern, will be fixed later :)
Try to set the yAxis.showLastLabel options to true
Demo: https://jsfiddle.net/BlackLabel/hqv97ws0/
yAxis: {
showLastLabel: true,
},
API: https://api.highcharts.com/highstock/yAxis.showLastLabel
You can set how many decimal values should be shown in the tooltip for each series:
API: https://api.highcharts.com/highcharts/series.line.tooltip.valueDecimals
I don't understand here - could you reproduce this issue as a really simple chart with sample data? You can use the above demo.
That's weird, ticks should be applied with setting the yAxis.minorTicks to true. Could you reproduce this issue also?
Demo: https://jsfiddle.net/BlackLabel/dLy6x59q/

How can I configure the TapTool so it does not hide other data points when clicked?

At the moment when a data point is clicked, all other data points are shaded. Is there a way to prevent this?
fig = fig.circle(x, y)
Ideally, I would like to increase size of the selected circle instead. Is there an easy why to do so?
Update
Seems we cannot change size... according to here:
Only the visual properties of selection_glyph and nonselection_glyph are considered when renderering. Changing
positions, sizes, etc. will have no effect.
However, we can simulate it using line_width property, it becomes more fun if I combine it with line_dish.
As of Bokeh 0.12.15, you can set nonselection_glyph=None when you call a glyph method, for example:
p.circle(x, y, radius=radii, fill_color="navy",
line_color=None, fill_alpha=0.6,
# this is the new part
nonselection_glyph=None)

How to set logarithmic scale and axis limits in HistogramLUTItem in pyqtgraph

I'm using pyqtgraph for a live view of a camera acquisition program. Most of the times my images are composed of a lot of background noise and a signal of just a few pixels with higher intensity. For that reason, the part of the HistogramLUTItem that corresponds to the actual signal looks like a thin line and the noise is big next to it. Being able to plot the logarithm of the data would make the data to stand up more.
Is this possible?
I'm currently creating the histogram this way:
imagewidget = pg.GraphicsLayoutWidget()
self.p1 = imagewidget.addPlot()
self.img = pg.ImageItem()
self.p1.addItem(self.img)
self.p1.getViewBox().setAspectLocked(True)
self.hist = pg.HistogramLUTItem()
self.hist.setImageItem(self.img)
self.hist.autoHistogramRange = False
imagewidget.addItem(self.hist)
Doing self.hist.axis.setLogMode(True) didn't work as it affected the x-axis of the histogram instead of the y-axis.
And finally, I would also like to be able to limit the accesible range in the x-axis of the histogram. How can this be done?
Cheers!
Ok, I finally figured out. In case someone wonders, I solved it by adding these two lines:
self.hist.plot.setLogMode(False, True)
self.hist.vb.setLimits(yMin=0, yMax=16000)

Resources