Comments (8)
This is possible in PLplot using either Plplot.Plot.axes or Plplot.plslabelfunc. Owl may need some modification to integrate this properly but the underlying support is there.
from owl.
Thanks ! Indeed the underlying structure is abstract in Owl :-/
from owl.
@zoggy Definitely an important function, I added it. I hope the following code will work for you for the time being. It is only in the master branch and not in the OPAM release yet.
let x = Vec.sequential 4;;
let y = Vec.uniform 4;;
let h = Plot.create "labeltest.pdf";;
Plot.plot ~h x y;;
Plot.set_xticklabels h [0.,"Jan"; 1.,"Feb"; 2.,"Mar"; 3.,"Apr"];;
Plot.output h;;
from owl.
Plot
module is actually quite straightforward. All the information of a page is saved in a record (of type page
). All the operations you have done on a page will be cached in a list page.plots
. Whenever you call output
function, Plot
module will call _initialise
, _prepare_page
, _finalise
these three functions to actually finish "drawing" your plot then output.
from owl.
Thanks. I had to opam pin to master branch of eigen too but no problem.
Plot.set_xticklabels
works, except that some labels do not appear; I though this was a question of missing space and reduced the font size, but no. Is there something more to do ?
from owl.
I guess this is because currently Owl only draws at the major ticks, the reason is plslabelfunc
calls the callback function whenever it encounters the major ticks. @hcarty should know more about how to customise the ticks in Plplot.
from owl.
First an API suggestion: maybe the Plot.set_*ticklabels
function should take a list of (value : float, label : string)
tuples? That will guarantee that a user can't accidentally pass in lists of mismatched lengths.
Second, regarding tick spacing and labeling - there is detection logic in the C core of PLplot which handles this. I don't recall the details - it's been a while since I hacked on that code - but it is possible to manually specify the major (plsmaj
) and minor (plsmin
) tick spacing. IIRC all major ticks are labeled by default.
For for your months example @zoggy, if no sub-monthly variability is shown, the major tick spacing would be 1.0
and minor ticks would be hidden.
from owl.
The API suggestion is really nice. I have changed it.
from owl.
Related Issues (20)
- LAPACKE problems HOT 2
- Precedence and associativity with infix operators
- Not all modules have aliases
- Ndarray sum keep_dims:true does not always keep dimensions
- Invalid_argument("index out of bounds") with Algodiff HOT 3
- Painful installation on MacOS HOT 4
- Can't build a module using Owl_stats_dist in dune, works in utop (arm64 mac) HOT 1
- How do I use gaussian_pdf in Owl.Arr? HOT 2
- The setter function for matrices in Owl_algodiff.D.Mat does not work HOT 2
- Cannot install owl-1.1 through opam because of `unmet availability conditions` HOT 2
- `libgfortran.so` not linked and causing compilation error HOT 8
- Cephes build warnings on Arch Linux
- Incorrect `Owl_const.min_float64` value? HOT 1
- Owl_dataframe shouldn' t use 'string_of_float' HOT 1
- Documentation is not in sync with current way plots are working
- OCaml cannot fins owl package HOT 1
- ssqr_diff' modifies inputs in place HOT 2
- Failure to load datasets for neural nets HOT 1
- Broken link to Algodiff module. HOT 2
- Exponential regression -- incorrect case HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from owl.