Gadfly.jl icon indicating copy to clipboard operation
Gadfly.jl copied to clipboard

How to shows the axis ticks little line?

Open ehdiix opened this issue 6 years ago • 6 comments

So, basically I want to make plot that shows the axis ticks little line but doesn't show the grid lines inside the panel. Is it possible?

image

image

ehdiix avatar Oct 24 '17 00:10 ehdiix

wow, what an omission.

i was hoping grid_color or grid_line_width in Theme could be used as a hack, but those both effect the axis ticks as well.

relevant code is here.

need to think about the user interface. perhaps adding a boolean grid keyword argument to Guide.{x,y}ticks.

bjarthur avatar Oct 28 '17 12:10 bjarthur

I encountered same problem recently. I used the following code to make a plot that has a border and no grids inside the polt, which is quite common in a lot of academic papers. However, I don't know how to add ticks on the x-axis and y-axis without having grids. Is this possible? If not, will it be added as a feature in the future? I think it would be a useful one. Thank you!

using Compose, DataFrames, Gadfly, RDatasets
D = dataset("datasets", "iris")
p = plot(D, 
              x=:SepalLength, y=:SepalWidth, 
              color=:Species, 
              Theme(panel_stroke=colorant"black", 
                          grid_line_width=0mm))

frankwswang avatar Mar 27 '20 21:03 frankwswang

Adding tick marks is not on my current Roadmap #1385, but there is PR #792 which appears abandoned, so someone could modify/update.

Mattriks avatar Mar 27 '20 22:03 Mattriks

For what it's worth, I would also find this very helpful

wilburtownsend avatar Mar 30 '20 00:03 wilburtownsend

@frankwswang Thanks for the solution but, I do not need the upper and right panel stroke. Is it possible?

bearberror avatar May 30 '22 08:05 bearberror

I don't know how to resolve that issue. Sorry!

frankwswang avatar Aug 06 '23 22:08 frankwswang