https://docs.bokeh.org/en/latest/docs/reference/models/formatters.html
I have found the 'precision' property and it looks like this is what I want to use. I have a figure p and am trying to set the axes labels to show a specific number of decimal places. Currently, the labels look like:
1.949, 1.95, 1.951, 1.952, 1.953
But I want:
1.949, 1.950, 1.951, 1.952, 1.953
How do I actually implement this precision property to my axis label to change it?
For example, I have tried `p.models.formatters.TickFormatter.precision = 3'
And playing around with the terms after "p." but it keeps giving:
AttributeError: 'Figure' object has no attribute 'models'
The documentation on the website is confusing to me. What line do I put in my code to use this 'precision' property?
Thank you.
You probably want:
from bokeh.models import NumeralTickFormatter
p.xaxis[0].formatter = NumeralTickFormatter(format="0.000")
The code for which is taken nearly verbatim from the User's Guide section on Tick Label Formats
The documentation on the website is confusing to me.
As a gentle aside, comments like this are frustrating to maintainers, because they are not actionable. There are lots of docs resources, which specific ones did you find or try to use and have problems with? What exactly did you try searching for that didn't lead you to e.g. the link above? Even if we wanted to consider trying to make some or other improvement based on your experience, there is not enough information provided in statements like this to be able to do anything.
Related
I'm building a Bayesian network (DAG) in R, it has several nodes stemming from one parent, so it has a lot of nodes.
I can't seem to figure out how to increase the font size of the node labels (won't let me post image).
To plot it, I've just done plot(dag_pigment).
Where the input is this:
dag_pigment<-dag(c("pigment","1800407"),c("pigment","12203592"),c("pigment","12896399"),c("pigment","3829241"),c("3829241","12913832"), c("pigment","1408799"), c("1408799", "12913832"),c("pigment","683"),c("pigment","10777129"),c("pigment", "28777"),c("pigment", "16891982"),c("pigment", "6119471"), c("pigment", "1426654"),c("pigment", "1800414"),c("pigment", "4959270"),c("pigment", "2378249"),c("pigment", "12821256"),c("pigment", "1805007"))
I've tried using cex within the plot function, and all the other subcategories (cex.main, cex.sub,etc.)
I've tried using ps, and I've tried using par like par(ps=20,cex=1,cex.main=1).
Are there other functions I should be trying? A different plot function?
Appreciate any help! I'm still pretty new at figuring these things out.
Ok, I actually figured this out after several hours, so, I'm posting the answer to be helpful for anyone else who might be looking.
You have to use the attrs function:
dag_pigment.cust<-plot(dag_pigment,attrs=list(node=list(fontsize=60)))
and this increased the font.
This seems like a straightforward problem, yet I can't find a solution. In Sage, I've got about 30 sorted points for a scatter_plot, and I want to add the order position as a label. I know this is easy if I were working with a graph object, since I could use the vertex_labels option in plot. Is there a simple fix to get this to work for a scatter_plot, or would I need to do something like make the points vertices and keep track of the exact location of each point
Currently, you may have to use matplotlib directly or mess around with that method inside of Sage to get this. See here or here for some related questions.
I've opened Trac 20583 for this.
I made a heatmap on R and most of it is one colour. I have two columns of data which showed up as various colours, but the rest of it is red.
Does anyone know how to increase the "resolution" of this? I don't mean anything about how to make the image more clear (which is why I think I'm having trouble searching for info on it). I mean, how do I make my heatmap more meaningful and not all mostly one colour.
Thanks and sorry if this has been answered somewhere else. I think I don't know the key term I need to search properly.
Edit:
Here is the code I used so far (heatdata is my matrix):
heatmap <- heatmap(heatdata,Rowv=NA,Colv=NA,col=cm.colors(256),scale="row")
I'm working with a lot of rank data that would benefit from a way to simultaneously display its respective year on the x-axis. For example, I want to create the following graph adapted from the dygraph gallery:
Note how the rank information (red arrow) for a particular weekend (green arrow) are both displayed on the x axis.
I know this might not be possible with dygraphs now, at least it wasn't available in these demos, so I guess my follow up question would be are there any plans to make this possible (how about in the [r] {dygraph} package)? Apparently a plotter called flot can do this.
UPDATE 1
If indeed this feature does not exist yet, then the following, although potentially obvious to Dygraph developers, is a thought for accomplishing the task easily (perhaps I'm wrong). At first I thought it would be necessary to provide input data of the form shown in Table A
However such input is a major deviation from the existing Dygraph parser model who expects one abscissa. Such suggests that a modification to the parser to accept a "Dual Label" option, requiring that both labels be contained in a single abscissa element as in Table B, would be easier. Thereafter, with the option specified, the parser would manage CSV as it usually would with the exception that it is now "bin cognizant" and detects division between labels 1 and 2 by use of an acceptable delimiter (in this case a single quotation mark - maybe not the best choice) and divisions between label 1 abscissa elements by name change. Behind the scenes each point gets its unique x coordinate and the "Dual Label" option causes the dygraph to visually scoot up a couple pixels to accommodate an extra label. Not sure how to handle full zoomed scrolling put simply leaving a label 1 element centered until an adjacent label 1 element comes on screen is an option.
Dygraphs rule!
There's no simple way to do this with dygraphs now. As you say, there's a fairly deep assumption that there's only a single x-axis.
Your best bet would be to either modify the existing legend plugin to do this, or to create a new plugin which renders just the "Weekend 1", "Weekend 2" line. While the plugins API isn't official yet, it is at least somewhat documented.
If you get this to work, please share your code!
I successfully made a program by using qvtkwidget, showing a few lines and points. And everything works perfectly. Next, I want to add an edit mode to my program, so that I can draw a line on it, or select some points or lines from it. Could anyone give me some guidelines for doing that? Do I need to use vtkRenderWindowInteractor? I tried to google but still can't find any clue.
you have to work with vtkinteraction, vtkobserver- callback, and vtkselection modules. and this example also useful http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex HTH
And here is set of examples you may find relavent to your goal
http://www.vtk.org/Wiki/VTK/Examples/Cxx#User_Interaction