KristofferC / PGFPlotsX.jl

Plots in Julia using the PGFPlots LaTeX package
Other
301 stars 40 forks source link

Custom colorbar #189

Closed BeastyBlacksmith closed 4 years ago

BeastyBlacksmith commented 4 years ago

I try to figure out, how to do custom colorbars. I tried the following:

using PGFPlotsX
push!(GFPlotsX.CUSTOM_PREAMBLE, """
\\pgfplotsset{\n    colormap={the_colorbar}{rgb=(0.67843137,0.84705882,0.90196078)\nrgb=(0.00000000,0.00000000,0.54509804)},\n}
"""
PGFPlotsX.Plot( PGFPlotsX.Options( "colormap" => nothing, "colormap name" => "the_colorbar"), PGFPlotsX.Coordinates(1:5, 1:5))

Which results in

! Package pgfplots Error: Sorry, you need to provide at least two points of a c
olormap..

Which is wierd, since there are two points?

tpapp commented 4 years ago

I would suggest

  1. figuring out the desired output in LaTeX,

  2. using print_tex to compare the output from PGFPlotsX.

Feel free to ask for help here if something should be fixed/extended, but figuring out (1) would be helpful first.

KristofferC commented 4 years ago

We do use a custom color map for Colorants https://github.com/KristofferC/PGFPlotsX.jl/blob/bed8c09a1636ec884d2ad6897124ae853a8d12c7/src/requires.jl#L46

https://kristofferc.github.io/PGFPlotsX.jl/stable/examples/juliatypes/#Colormap-1

BeastyBlacksmith commented 4 years ago

got this... confused colormap and colorbar