Comments (6)
This isn't a Juno specific issue:
λ j1 --quiet
julia> using Colors, ColorBrewer
julia> colors = ColorBrewer.palette("Set1", 9);
julia> show(stdout, MIME"image/svg+xml"(), colors)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
width="180.0mm" height="25.0mm"
shape-rendering="crispEdges">
<rect x="0.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#E41A1C" stroke="none" />
<rect x="20.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#377EB8" stroke="none" />
<rect x="40.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#4DAF4A" stroke="none" />
<rect x="60.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#984EA3" stroke="none" />
<rect x="80.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#FF7F00" stroke="none" />
<rect x="100.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#FFFF33" stroke="none" />
<rect x="120.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#A65628" stroke="none" />
<rect x="140.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#F781BF" stroke="none" />
<rect x="160.0mm" y="0.0mm"
width="19.0mm" height="24.0mm"
fill="#999999" stroke="none" />
</svg>6
julia> append!(colors, [colorant"white"])
ERROR: cannot resize array with shared data
Stacktrace:
[1] _growend! at ./array.jl:814 [inlined]
[2] append!(::Array{RGB{FixedPointNumbers.Normed{UInt8,8}},1}, ::Array{RGB{FixedPointNumbers.Normed{UInt8,8}},1}) at ./array.jl:897
[3] top-level scope at none:0
from colors.jl.
I'd suggest transpose
instead, since it doesn't prevent growth:
julia> a = [1,2]
2-element Array{Int64,1}:
1
2
julia> b = transpose(a)
1×2 LinearAlgebra.Transpose{Int64,Array{Int64,1}}:
1 2
julia> push!(a, 3)
3-element Array{Int64,1}:
1
2
3
Though I guess colors don't support transpose, so make that Base.ReshapedArray(colors, (1, length(colors)), ())
.
PR welcome.
from colors.jl.
Won't change this without clearer justification: what's the error on Juno and why can't it be fixed within Juno?
from colors.jl.
@timholy sorry for the terseness and thanks @pfitzseb for jumping in. TBH I wasn't really sure what was going on, but wanted to plant the flag after discussing it on slack, since @pfitzseb said he couldn't get to it right away.
from colors.jl.
Want to try a pull request? The answer is right above you, just needs someone to push it over the finish line.
from colors.jl.
Sure!
from colors.jl.
Related Issues (20)
- [Request] Allow for more than two colors in `weighted_color_mean`. HOT 2
- `NaN`s are not showable HOT 3
- Not work on Ubuntu 2004 HOT 5
- RGB -> XTerm256 approximation? HOT 13
- move storage type conversion trait from ImageCore to Colors HOT 6
- Optimizing the types used for intermediate calculations HOT 5
- Source of the YIQ transform matrix HOT 1
- is `inv` on Colors well defined? HOT 4
- Fatal performance degradation due to precompilation or inference bugs HOT 8
- MethodError: no method matching coloralpha(::Type{RGB24}) HOT 1
- What should `default_brettel_neutral` be? HOT 1
- Ambiguity with AbstractTrees
- 'Render' colours in REPL HOT 15
- in the README, put a link on the home page HOT 2
- colorwheel generator HOT 1
- add colorwheel generator HOT 1
- Release v0.13? HOT 2
- Ambiguous show method for `Union{}[]` HOT 3
- colormap("<Color>", maxcount; w=<Int>, logscale=<Bool>) stackoverflows HOT 7
- oklab/oklch for CSS4 and cheap deltaE 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 colors.jl.