Comments (2)
I can't tell whether you think the circle or rectangle (or both) are "inconsistent".
In Compose.jl, circles are always circles (this behaviour is useful for plotting e.g. in Gadfly.jl you can change the size of image to fit your publication, and still get point circles). The radius defaults to cx units, but you can change to cy
as shown below (or other units). Other forms should behave as you expect: e.g. in both your images the rectangle is drawn relative to the UnitBox coordinates. So both the rectangles and circles are correct as designed.
Two notes:
- The circle didn't get clipped in your second image: did you convert the svg to png in another program?
- Compose also has a fourth type of unit (
sx,sy
) (#409). Unfortunately the docs have not been deploying correctly (#410), but the info can be found in the doc md files.
gridf(xs, ys, args...) = (context(),
line([[(x, 0h), (x, 1h)] for x in xs]), line([[(0w, y), (1w, y)] for y in ys]), args..., linewidth(0.1mm))
c3 = compose(context(units=UnitBox(-2., -2., 4., 4.)),
gridf(-2:2, -2:2, stroke("gray")),
# (context(), rectangle(-1, -1, 2, 2), fill("red")),
circle([0], [0], [1.5cx, 1.5cy]), fill(["deepskyblue","coral"])
)
draw(PNG("Comp431.png", 10cm, 5cm), c3)
from compose.jl.
Indeed, my circles are clipped in svg, this is due to conversion to png.
Ok, I didn't see that there were absolute and relative coordinates, I should have read the documentation more carefully.
I understand the rationale, but it still feels weird that the circle favors the x
coordinate.
from compose.jl.
Related Issues (20)
- Compatibility with GeometryBasics? HOT 2
- Revise + Requires + Cairo + Fontconfig + Compose produces a pango error HOT 1
- ngon and xgon are transformed incorrectly in UnitBox? HOT 1
- Compose docs not deploying HOT 3
- tests fail on 1.6
- TagBot trigger issue HOT 9
- Guidance on a hyperbolic drawing extension
- `introspect` for graphs which are not trees
- Improve documentation for introspect HOT 1
- Document type hierarchy? HOT 1
- Make display in the REPL
- using Gadfly causes Method error in AlgebraOfGraphics.draw() HOT 2
- how to use SVG attributes?
- Dangerous pirate of `fill` function
- tests fail in windows 11 HOT 1
- Colors lost when using large vectors... HOT 8
- Rectangle rotation doesn't work HOT 3
- Bitmaps (at least, SVGs) do not rotate in a `context(..., rotation=Rotation(θ)`
- Unsupressable output to stdout(?)
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 compose.jl.