-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
unable to set tickwidth and tickcolor via template #4852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@alexcjohnson plotly.js/src/plots/cartesian/layout_defaults.js Lines 219 to 221 in bee2455
Should we support |
I think the problem is a little more subtle than that. We do support templating axes, but currently Consider: just adding empty containers for the axes also doesn't show the ticks: Plotly.newPlot(gd, {
data: data,
layout: {
template: {layout: layout},
yaxis: {},
xaxis: {}
}
}); But if you explicitly turn the ticks on they have the style from the template: Plotly.newPlot(gd, {
data: data,
layout: {
template: {layout: layout},
yaxis: {ticks: 'outside'},
xaxis: {ticks: 'inside'}
}
}); And if you turn ticks on explicitly from the template, that also makes them appear: var layout = {
"yaxis": {
"type": "log",
"tickwidth": 5,
"tickcolor": "green",
ticks: 'outside'
},
"xaxis": {
"type": "date",
"tickwidth": 50,
"tickcolor": "red",
ticks: 'outside'
}
};
Plotly.newPlot(gd, {
data: data,
layout: {
template: {layout: layout}
}
}); What's happening is in this block: plotly.js/src/plots/cartesian/tick_mark_defaults.js Lines 21 to 24 in bee2455
In this particular case I think it's clear that we want to consider the template value to be "non-default" and to therefore cause ticks to be shown. I think that's a generally true statement, following from the principle that |
Reopening after the revert by #5016. |
is it true that we can't set the tickwidth etc in the template ? or just that we have to also show the ticks from the template? |
We were unable to set that before |
I can't agree with "we cannot set that" ... if you also set |
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson |
Demo
The text was updated successfully, but these errors were encountered: